Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

key is of invalid type, []byte('key') - not working #451

Open
yongDataScince opened this issue Feb 9, 2021 · 1 comment
Open

key is of invalid type, []byte('key') - not working #451

yongDataScince opened this issue Feb 9, 2021 · 1 comment

Comments

@yongDataScince
Copy link

`token := jwt.NewWithClaims(jwt.SigningMethodES256, &tokenClaims{
jwt.StandardClaims {
ExpiresAt: time.Now().Add(tockenTTL).Unix(),
IssuedAt: time.Now().Unix(),
},
user.ID,
})

signKey := []byte("kdnjsndjnd*jdnj212md")

tkn, err := token.SignedString(signKey)
return tkn, err`

Originally posted by @yongDataScince in #65 (comment)

@huanghongqing
Copy link

SigningMethodES256 ==> SigningMethodHS256

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants