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
Due to the way that EssentialClaims are parsed from JSON, the aud claim must always be an array in the source data.
EssentialClaims
aud
For example, this sample app will fail the audience check:
package main import "github.com/lestrrat/go-jwx/jwt" import "fmt" import "encoding/json" func main() { var claimSet jwt.ClaimSet err := json.Unmarshal([]byte(`{ "ver": 1, "jti": "AT.yhqxyRwZa5koTnwWQ8G1QV4s2cGYqApe6s22lLjzqJg", "iss": "https://my.issuer.domain", "aud": "http://my.audience", "iat": 1504131487, "exp": 1514678399, "cid": "1234", "uid": "5678", "scp": ["users"], "sub": "hopkinsth@gmail.com" }`), &claimSet) if err != nil { panic(err) } // will print "aud not satisfied" assuming the `exp` time hasn't passed fmt.Println(claimSet.Verify(jwt.WithAudience("http://my.audience"))) }
On this the JWT RFC says, basically, aud can be an array or a string: https://tools.ietf.org/html/rfc7519#section-4.1.3
Planning to file a pull request for a fix later... submitting this partly as a reminder.
The text was updated successfully, but these errors were encountered:
👍 👍 👍
Sorry, something went wrong.
Closing this as it has been ages since last activity
No branches or pull requests
Due to the way that
EssentialClaims
are parsed from JSON, theaud
claim must always be an array in the source data.For example, this sample app will fail the audience check:
On this the JWT RFC says, basically,
aud
can be an array or a string: https://tools.ietf.org/html/rfc7519#section-4.1.3Planning to file a pull request for a fix later... submitting this partly as a reminder.
The text was updated successfully, but these errors were encountered: