Cognito - error_description username attribute mapping
Asked Answered
B

2

16

I've configured a User Pool in Amazon Cognito to be able to sign-in/sign-up users and I've setup facebook as identity provider.

On my hosted ui (https://xxx.auth.us-east-1.amazoncognito.com/login?client_id=2yyy&redirect_uri=zzzz.com.br&response_type=code), I could successfully click on "continue with facebook" but after I got redirect to my return_uri the following error as query parameter was shown:

https://zzzz.com.br/?error_description=username+attribute+mapping+required&error=invalid_request#=

Under the "Attribute mapping" configuration I already have facebook attribute "id" mapped to User pool attribute "Username"... After some hours struggling with this I decided to ask you guys for help!

Thanks in advance.

Burse answered 20/5, 2018 at 0:48 Comment(5)
I'm hitting this error, but only on some facebook login accounts, any chance you found a solution @Vinicius LimaLeila
@Leila Any chance that these are Facebook users who registered with Facebook using mobile number only? Is email a required attribute of your user pool?Trephine
@MikePatrick no, they aren't. But even if there were, I'm not trying to get the email, the id is mapped to cognito's Username. The only hint I have with my test user (which can't login) is that the account is VERY old. I can login using facebook, and the app gets permission, but cognito returns the mapping error.Leila
@Leila I couldn't find the solution and I have migrated to firebase services instead. I lost 2 days digging on it.Burse
thanks @ViniciusLima unfortunately, I don't think firebase is an option for us.Leila
P
0

The attribute in the user pool must be large enough to contain the values of the mapped identity provider attributes, or an error will occur when users sign in. Custom attributes should be set to the maximum 2048 character size if mapped to identity provider tokens. Configure Attribute Mapping for your user pool.

Pa answered 18/1, 2022 at 6:18 Comment(0)
P
0

I think you have to try to map username to OIDC sub

Pacheco answered 14/11, 2022 at 19:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.