Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Added support for array values for the aud field #286

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

katerji92
Copy link

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.

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.
@sethpnc
Copy link

sethpnc commented Mar 26, 2021

What is the status of this PR? This appears to be a fix for a security issue that is affecting us downstream.

@alvaradojl
Copy link

so when is this PR going to be merged?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants