close
The Wayback Machine - https://web.archive.org/web/20201231102004/https://github.com/dgrijalva/jwt-go/pull/286
Skip to content
New issue

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

Added support for array values for the aud field #286

Open
wants to merge 4 commits into
base: master
from

Conversation

@katerji92
Copy link

@katerji92 katerji92 commented Aug 14, 2018

As per the JWT spec, the aud claim field can be either a single string value or an array of strings.

jwt-go would completely drop array values as the StandardClaims struct's Audience field is a string value and the value is dropped upon deserialization.

katerji92 added 4 commits Aug 14, 2018
to an interface{} type.

An ExtractAudience function with its test cases has been added to
interpret the Audience field as an []interface, []string, and string
and extract a []string of audience values.
passed claim against an array of audiences rather than a singular value.
Cleaned up the claims.go test cases.
looking-promising added a commit to gospotcheck/jwt-go that referenced this pull request Jan 14, 2019
This was created based on the following PR:
dgrijalva#286

As per the JWT spec, the aud claim field can be either a single string value or an array of strings.

jwt-go would completely drop array values as the StandardClaims struct's Audience field is a string value and the value is dropped upon deserialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.