Amplify-js: Integrating Social Login (Google, Facebook) with Cognito in an Expo App (CUSTOM UI)

Created on 28 Jun 2019  路  12Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *
AWS Amplify, Auth, Social sign in

* What AWS Services are you utilizing? *
AWS Federated Login

* Provide additional details e.g. code snippets *
I'm running into some problems trying to get social sign in working in an expo app.

I'm using the Auth.federatedSignIn method calling the Facebook and Google providers.

The current work flow is:

User clicks login through facebook/google - WORKING
Browser opens with FB/Google oAuth sign in page - WORKING
User logs in with credentials - WORKING
Browser window redirect back to Expo app - WORKING

Here is where the issue arises - I have configured the Hub to listen to auth events and it is receiving data. I'm receiving a signIn_failure and a cognitoHostedUI_failure.

I should add that I am not using the Hosted UI - unfortunately this is not an option for us.

Auth React Native pending-close-response-required

All 12 comments

@jmzwar Hi what's the error you are getting in that event payload?

@powerful23 Thanks for the quick reply but I found a solution integrating social sign in with user pools.

@jmzwar can you share which solution you're using? looking for something better than the Hosted UI. Thanks!

@jmzwar Can you share your solution, because I am also getting the same error with Expo setup

@iamdavidmartin @dineshmatta Are you using User pools or Federation? I had some initial confusion regarding the difference between the two.

@jmzwar I am using Federation login using social providers - https://aws-amplify.github.io/docs/js/authentication#oauth-and-federation-overview

@jmzwar both. for each new user who authenticates with federated social providers, a new user gets put into a user pool.

users sign up with the Hosted UI. I'm curious how you're managing user sign in/up without the hosted ui.

@jmzwar, it looks like the original issue posted is solved correct?

@dineshmatta @iamdavidmartin, did you guys make any progress or are you guys still stuck?

i'm not stuck. i'm using the hosted UI with Expo and that's a good option because the user doesn't leave the app - the auth browser window overlays the app and the user comes right back.

but, if i could make a wish, i would get rid of the hosted UI and have a tighter integration with the social login buttons. amplify has the nice withAuthenticator react-native component that allows a user to auth with amazon. wouldn't it be nice if it were so nicely packaged with facebook/google/(and we hope soon to be apple)? that would make for a better user experience.

I'm too using hosted UI with Expo, so at this moment I am not blocked, but I agree with @iamdavidmartin that there should be tighter integration with social login buttons

UPDATED: As based on the above Pull Request that was merged in, this issue seems to be resolved. @jmzwar, can you confirm this?

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

Was this page helpful?
0 / 5 - 0 ratings