FusionAuth/go-client

JWT Validation missing fields

domgolonka opened this issue · 3 comments

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": "domgolonka@domgolonka.com",
        "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.

ynnt commented

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:

type JWT struct {

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
#34
#38