Cognito auth flow fails with “Already found an entry for username Facebook_10155611263153532”

后端 未结 4 1665
悲&欢浪女
悲&欢浪女 2020-12-24 14:20

The goal is to implement a social provider auth flow as described in User Pools App Integration and Federation.

One important thing that I want to satisfy, is to merg

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 14:33

    For all the poor souls fighting with this issue still in 2020 the same way I did:

    • I have eventually fixed the issue by catching the "Already found an entry for username" in my client application and repeating the entire auth flow once more.
    • Luckily the error only gets fired on the initial external provider signup but not in the subsequent signins of the same user (cause it happens during signup trigger, duh). I'm taking a wild guess, but here is what I think is happening:
      • In my case, the facebook provider was getting succesfully linked with the pre-existing cognito email/password user. new Facebook userpool entry linking to the email/password user was succesfully created.
      • Still, it seems like cognito tried to register the fully isolated Facebook_id user during the internal signup process (even though a link user entry with the same username was already created in the previous step). Since the "link user" with the username Facebook_id was already existing, cognito threw an "Already found an entry for username Facebook_id error" internal error.
      • This error has been repeatedly voiced over to the AWS developers since 2017 and there are even some responses of them working on it, but in 2020, it's still not fixed.

提交回复
热议问题