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

Incorporate string array in aud field from the original v4 branch #32

Closed
dcormier opened this issue Jun 30, 2021 · 3 comments · Fixed by #15
Closed

Incorporate string array in aud field from the original v4 branch #32

dcormier opened this issue Jun 30, 2021 · 3 comments · Fixed by #15

Comments

@dcormier
Copy link

dcormier commented Jun 30, 2021

The original repo has a pretty complete v4 release that I'm using (docs).

As I recall, I needed v4 because of this change:

Added new type, ClaimStrings, which will correctly handle properties such as aud that can be either an array of strings or a single string. ClaimStrings is an alias to []string, but with custom decoding behavior. This means all the built in aud validation behavior now expects []string instead of string. This was a common request.

It would be nice to see that picked up and moved forward, as well.

@oxisto
Copy link
Collaborator

oxisto commented Jun 30, 2021

I have tried to put that functionality in #15. Could you have a look whether this fulfills your use case?

@dcormier
Copy link
Author

dcormier commented Jul 1, 2021

It looks like that probably would handle that my use case.

@mfridman mfridman mentioned this issue Jul 29, 2021
2 tasks
@oxisto oxisto changed the title v4? Incorporate string array in aud field from the original v4 branch Jul 31, 2021
@dunglas
Copy link
Contributor

dunglas commented Aug 3, 2021

This is currently a BC break. When using StandardClaims with an aud field containing a string, this error is now thrown: unable to parse JWT: json: cannot unmarshal array into Go struct field claims.aud of type string.

Using the new RegisteredClaims introduced in #15 works properly, but even with this patch the BC break is still present of the deprecated StandardClaims struct.

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

Successfully merging a pull request may close this issue.

3 participants