Amplify-cli: When given name is set as a required attribute and Facebook is configured as an identity provider, the attribute mapping is set incorrectly.

Created on 30 Jul 2020  路  3Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
When given name is set as a required attribute and Facebook is configured as an identity provider, the attribute mapping is set incorrectly. rather than first_name to be mapped to given name, given_name is mapped, which is not provided in the token passed by facebook and would cause the following error:

ror handling auth response. Error: attributes+required%3A+%5Bgiven_name

To Reproduce
When configuring auth, set given name as a required attribute and add facebook as an identity provider

Expected behavior
first_name to be mapped to given Name

Screenshots
wrong:
image

correct:
image

auth bug

All 3 comments

if anyone else is facing this issue, you can solve it by modifying the parameters.json file and changing the "hostedUIProviderMeta"

[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"family_name\":\"last_name\",\"given_name\":\"first_name\",\"username\":\"id\"}}]

This needs to be moved to amplify-cli

This is a bug. I also experience it. Facebook's first name is mapped incorrectly in Amplify CLI.

Changing \"given_name\":\"given_name\" to \"given_name\":\"first_name\" do the trick.

Was this page helpful?
0 / 5 - 0 ratings