We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to extract claims from token like in this package (any example appreciated)?
The text was updated successfully, but these errors were encountered:
In order to parse the token you'll need to verify it:
import "github.com/gbrlsnchs/jwt/v3" type CustomPayload struct { jwt.Payload Foo string `json:"foo,omitempty"` Bar int `json:"bar,omitempty"` } var hs = jwt.NewHS256([]byte("secret")) func main() { // ... var pl CustomPayload hd, err := jwt.Verify(token, hs, &pl) if err != nil { // ... } // ... }
This was done on purpose in order to avoid security flaws where users use data from tokens that weren't validated.
Let me know if this info is enough for you so I can close this issue. 😃
Sorry, something went wrong.
gbrlsnchs
No branches or pull requests
Parsing token and getting payload
Is there any way to extract claims from token like in this package (any example appreciated)?
The text was updated successfully, but these errors were encountered: