go-client
go-client copied to clipboard
JWT Validation missing fields
When trying to do curl [GET] request to validate:
{
"jwt": {
"exp": 1606240095,
"iat": 1606236495,
"iss": "acme.com",
"jti": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX",
"sub": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX",
"authenticationType": "PASSWORD",
"email": "[email protected]",
"email_verified": true,
"preferred_username": "domgolonka"
}
}
The above shows the email, email_verified, preferred_username, & authenticationType fields.
When trying to it using the client:
*fusionauth.JWT=&{<nil> 1606238646 1606235046 acme.com XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX 0 map[] XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX})
There are missing fields from the above.
This one is super annoying. Actually, it makes /oauth/userinfo endpoint useless.
I agree, this is something we'd like to solve. If you have some ideas how to solve it - input is appreciated.
Here is the current struct def: https://github.com/FusionAuth/go-client/blob/840527ef423ecbde988af5190fb99c17aa26172e/pkg/fusionauth/Domain.go#L1724
Here is article on dynamic JSON in Go: https://eagain.net/articles/go-dynamic-json/
If anyone wants to submit a PR or a suggested change that would be great!
@iveelsm feel free to take a crack at this one if it looks interesting.
Possibly related issues https://github.com/FusionAuth/go-client/issues/34 https://github.com/FusionAuth/go-client/issues/38