Replies: 1 comment
-
Wo do not fully support JWS, so I hope this works, but what you need to do is the following: token, err := jwt.ParseWithClaims(tokenString, &jwt.RegisteredClaims{}, func(token *jwt.Token) (interface{}, error) {
return publickey, nil
}
You probably also don't want to extract the public key by hand. There is an excellent library called http://github.com/MicahParks/keyfunc which you can use use as the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greeting folks,
I am currently trying to perform the validation of a JWT token issued by AzureActiveDirectory.
Here's the header:
{ "typ":"JWT", "nonce":"fF8GUtxqSoRupyeXtb-7Azd1VC9y0zmaV9HpBE2r4_w", "alg":"RS256", "x5t":"-KI3Q9nNR7bRofxmeZoXqbHZGew", "kid":"-KI3Q9nNR7bRofxmeZoXqbHZGew"}
I can find the corresponding certificate using the following API:
https://login.microsoftonline.com/common/discovery/keys
I'm trying to call Validate method through:
test := &jwt.SigningMethodRSA{}
err = test.Verify(signstring, signature, &publickey)
where:
At the time of the execution, Verify method returns an error:
the requested hash function is unavailable
I am not sure if this is linked to any pre-requisite not met or to any other mis-configuration of RSA hash.
Any clue about what I should be checking?
Beta Was this translation helpful? Give feedback.
All reactions