MaikuB/flutter_appauth

How to get UserInfo?

ShwetaChauhan18 opened this issue · 3 comments

I am getting this information after login success but now how can I get UserInfo from it??

accessToken = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZDQkMtSFM1MTIiLCJraWQiOiJZVFBPRFoyM0dFOUtYRTNRUkxDSFhHTkhTRkZUUEQ3T1JEN1FPOTFWIiwidHlwIjoi....."
refreshToken = null
accessTokenExpirationDateTime = {DateTime} 2023-06-05 20:45:43.505
idToken = null
tokenType = "Bearer"
scopes = null
tokenAdditionalParameters = {CastMap} {}
authorizationAdditionalParameters = {CastMap} {}

you have to decode the accesToken, you can use the following page https://jwt.io/ and in flutter use the library jwt_decoder

@kevdanguzalv: No, we can't decode this token. Any other way??

MaikuB commented

This is outside of the scope of this plugin and depends on how your app is built when it comes integrating with other platforms. This means you need to do the research for your own scenarios e.g. reading the docs of your identity provider to see if it implements https://openid.net/specs/openid-connect-core-1_0.html#UserInfo or provides another way to get the info