go-client icon indicating copy to clipboard operation
go-client copied to clipboard

Missing JWT Fields

Open domgolonka opened this issue 4 years ago • 2 comments

#45

domgolonka avatar Nov 24 '20 17:11 domgolonka

Thanks for the contribution @domgolonka .

This one is kinda tricky, this is a generated file.

Here is the template, and the JWT object definition. https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/go.domain.ftl https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/domain/io.fusionauth.jwt.domain.JWT.json

This object DSL is built from https://github.com/FusionAuth/fusionauth-jwt/blob/master/src/main/java/io/fusionauth/jwt/domain/JWT.java.

The additional fields you're looking for are claims defined by OIDC, but not in the JWT spec. In our Java client, these fields get de-serialized into the otherClaims field, and when we serialize the object it gets flattened.

We would need to identify if Go has a similar capability - to support these dynamic fields. I could also add a claim named foo to the JWT, but we can't define it ahead of time because we don't know what the JWT will contain.

robotdan avatar Nov 24 '20 18:11 robotdan

@domgolonka any interest in looking at how to support dynamic fields?

If not, I can close this PR.

mooreds avatar Jan 05 '22 21:01 mooreds