Using FlutterAppAuth, I invoke authorizeAndExchangeCode to authenticate user and obtain the access token. It’s working well.
Then I invoke the API call userinfo with that access token to obtain some profile information (Just interested in name, profile picture, email address).
It works well for users who authenticated with Google, but for Facebook, I just don’t receive the user email in the response, and I can’t figure out why.
Here’s the scopes parameter that I use with authorizeAndExchangeCode:
scopes: <String>[
'openid',
'profile',
'email',
'offline_access',
]
Here’s the return provided by /userinfo when user authenticates with Google (email is included, it’s correct)
{"sub":"google-oauth2|10790108857xxxxxxxxxx","given_name":"Eva","family_name":"My surname","nickname":"acalpixca","name":"Eva My surname","picture":"https://lh3.googleusercontent.com/a-/AFdZucrYYp5TNJBMAvm4k6VZ-1ydZ_H2v0hjxxxxxxxxxx=s96-c","locale":"es","updated_at":"2022-09-07T16:57:30.591Z","email":"xxxx@gmail.com","email_verified":true}
And here’s what I get for Facebook authentication (no email included )
{"sub":"facebook|10227469705xxxxxx","given_name":"Eva","family_name":"My surname","middle_name":"my middle name","nickname":"Whatever","name":"My full name","picture":"https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=10227469705xxxxxx&height=50&width=50&ext=1665161608&hash=AeSBydokjMvElZjvbHA","updated_at":"2022-09-07T16:53:28.234Z","email_verified":true}
Anyone has this working? Any tips anyone? Many thanks!!!