在 golang jwt-go 中解码 JWT
Decode JWT in golang jwt-go
这段代码 (https://github.com/auth0/java-jwt) 在 golang 中的等价物 --- jwt-go 库
DecodedJWT jwt = JWT.decode(token);
在 golang 的 jwt-go 库中,当我必须解析令牌时,我需要具有 java 库中不需要的验证密钥。
来自文档 at:
func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error)
WARNING: Don't use this method unless you know what you're doing.
This method parses the token but doesn't validate the signature. It's only ever useful in cases where you know the signature is valid (because it has been checked previously in the stack) and you want to extract values from it.
这段代码 (https://github.com/auth0/java-jwt) 在 golang 中的等价物 --- jwt-go 库
DecodedJWT jwt = JWT.decode(token);
在 golang 的 jwt-go 库中,当我必须解析令牌时,我需要具有 java 库中不需要的验证密钥。
来自文档 at:
func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error)
WARNING: Don't use this method unless you know what you're doing.
This method parses the token but doesn't validate the signature. It's only ever useful in cases where you know the signature is valid (because it has been checked previously in the stack) and you want to extract values from it.