amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

AWS Cognito hosted UI - Facebook API v2.11 breaks login #56

Closed jonasao closed 6 years ago

jonasao commented 6 years ago

Currently developing an authentication solution using AWS Cognito with userpool and hosted UI for login, where the user may choose between Facebook, Google and username/password login options.

Until today we have been using a Facebook app based on Facebook API v2.10, which have been working perfectly.

I have created a new Facebook app for my company, based on Facebook API v2.11 with the intention of replacing the existing Facebook app used when authenticating users via AWS Cognito.

These two apps have the exact same configuration, unfortunately the latter will not work!

When using the Facebook app that uses API v2.11, the situation is as follows: The user chooses to use Facebook as identity provider in the AWS Cognito hosted UI. Clicking the Facebook button returns an error message, stating that the user is not logged on instead of attempting to log on the user or give the user a chance to accept this Facebook app.

If the user is already logged on and chooses to use Facebook as identity provider, the user is presented with an error message stating that the client's redirect URL is wrong, and authentication fails. (This can't be the case since this Facebook app has the exact same configuration as the one using Facebook API v2.10.)

Facebook app ID and secret are both updated in AWS Cognito identity provider settings to match the ones for the Facebook app using Facebook API v2.11 - unfortunately this is not helping.

Anyone sharing the same experience?

ashwindevendran commented 6 years ago

Hi,

I took a quick look through the facebook API v2.11 changelog (https://developers.facebook.com/docs/graph-api/changelog/version2.11) and nothing strikingly pops up indicative of a breaking change. Are you making any further calls to the FB API post-sign-in or are you strictly using FB for signing-in?

In order to take a deep dive on this, it would be helpful if you were able to email me any of the failing request id's. My email is: ashwidev@amazon.com

joe455 commented 6 years ago

@jonasao Could you please tell me the what should be the domain url while implementing custom UI with facebook and cognito?

jonasao commented 6 years ago

@ashwindevendran I am only using Facebook to login, without any further calls. I have now tried to create another Facebook app, which gives me the same result. Could it be that somewhere in the AWS Cognito Hosted UI, the Facebook APP ID and/or secret is not being updated and/or reflecting the changes made under Facebook identity settings in AWS Cognito?

jonasao commented 6 years ago

@joe455 I have not added any domain URL under the Facebook application settings.

jonasao commented 6 years ago

@ashwindevendran There seems to be a bug at Facebook that causes this issue: https://developers.facebook.com/bugs/518422995172099/

jonasao commented 6 years ago

My mistake, embarrasing, but I made a typo in the redirect URI, replacing a hyphen with a punctuation.