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
424 stars 232 forks source link

How to use Facebook login with this SDK? #95

Closed Jun711 closed 6 years ago

Jun711 commented 6 years ago

I have enabled facebook as an identity provider on User Pools. I have also set my facebook testApp public. However, I got this error after I tried to sign in.

This is the error and url I see

Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

https://www.facebook.com/v2.9/dialog/oauth?client_id=157166428323868&redirect_uri=https%3A%2F%2Ftest-social.auth.us-east-1.amazoncognito.com%2Foauth2%2Fidpresponse&scope=public_profile%2C+email&response_type=code&state=ZXlKMWMyVnlVRzl2YkVsa0lqb2lkWE10WldGemRDMHhYM1JNYjNjMFRHRkhSaUlzSW5CeWIzWnBaR1Z5VG1GdFpTSTZJa1poWTJWaWIyOXJJaXdpWTJ4cFpXNTBTV1FpT2lJeU1qQnpaekptTTNGa1lqTmliRzFqY25KMk56bGtiV1J3YnlJc0luSmxaR2x5WldOMFZWSkpJam9pYUhSMGNITTZMeTl5WVhkbmFYUXVZMjl0TDBwMWJqY3hNUzloYldGNmIyNHRZMjluYm1sMGJ5MWhkWFJvTFdwekwzTnZZMmxoYkMxc2IyZHBiaTl6WVcxd2JHVXZhVzVrWlhndWFIUnRiQ0lzSW5KbGMzQnZibk5sVkhsd1pTSTZJblJ2YTJWdUlpd2ljSEp2ZG1sa1pYSlVlWEJsSWpvaVJtRmpaV0p2YjJzaUxDSnpZMjl3WlhNaU9sc2liM0JsYm1sa0lpd2ljSEp2Wm1sc1pTSmRMQ0p6ZEdGMFpTSTZJamhyWlc5V1IzcGxlblpvVUdsUWIyWnVhSFF4UjJWeVRVNVNRbTEyVEVOMUlpd2lZMjlrWlVOb1lXeHNaVzVuWlNJNmJuVnNiQ3dpWTI5a1pVTm9ZV3hzWlc1blpVMWxkR2h2WkNJNmJuVnNiQ3dpYm05dVkyVWlPbTUxYkd3c0luTmxjblpsY2todmMzUlFiM0owSWpvaWRHVnpkQzF6YjJOcFlXd3VZWFYwYUM1MWN5MWxZWE4wTFRFdVlXMWhlbTl1WTI5bmJtbDBieTVqYjIwaUxDSmpjbVZoZEdsdmJsUnBiV1ZUWldOdmJtUnpJam94TlRJd016Z3lPVFl5ZlE9PTpMSjQyK051OGhwcUtyRytwUVNVT1ZxZXFkbVozcmxxbGRRMkZ5cnZRK2prPQ%3D%3D

I think it is domain issue on facebook, so I just wonder what domain I should put. As of this case, I had test-social.auth.us-east-1.amazoncognito.com and https://test-social.auth.us-east-1.amazoncognito.com/ as the site url. And, I host my testApp on RawGit: https://rawgit.com/Jun711/amazon-cognito-auth-js/social-login/sample/index.html

I appreciate any pointer. thanks. please delete it if it is not supposed to be here. thanks

Jun711 commented 6 years ago

This is the issue:

In March, we're making a security update to your app settings that will invalidate calls from URIs not listed in the Valid OAuth redirect URIs field below.This update comes in response to malicious activity we saw on our platform, and we want to protect your app or website by requiring a new strict mode for redirect URIs.

So, it worked after I whitelisted test-social.auth.us-east-1.amazoncognito.com.