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

JWT Validation missing fields

Open domgolonka opened this issue 4 years ago • 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": "[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.

domgolonka avatar Nov 24 '20 17:11 domgolonka

This one is super annoying. Actually, it makes /oauth/userinfo endpoint useless.

ynnt avatar Dec 04 '20 12:12 ynnt

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!

robotdan avatar Dec 04 '20 17:12 robotdan

@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

robotdan avatar Dec 04 '20 17:12 robotdan