MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
273 stars 246 forks source link

How to get UserInfo? #430

Closed ShwetaChauhan18 closed 1 year ago

ShwetaChauhan18 commented 1 year ago

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} {}
kevdanguzalv commented 1 year ago

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

ShwetaChauhan18 commented 1 year ago

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

MaikuB commented 1 year ago

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