Amplify-js: No withFederated for react-native

Created on 19 Dec 2017  路  8Comments  路  Source: aws-amplify/amplify-js

I'm trying to implement a facebook authentication flow in my RN app but when I want to make use of federated auth I get the following:

screen shot 2017-12-19 at 15 38 34

Auth feature-request

Most helpful comment

Is there an ETA on when this will be added then? And is there a current workaround? I was looking at the amazon-cognito-identity-js library but haven't found any examples with external authentication.

All 8 comments

Hello, federated auth is not yet available for react native. Currently it is only available within the aws-amplify-react package.

Is there an ETA on when this will be added then? And is there a current workaround? I was looking at the amazon-cognito-identity-js library but haven't found any examples with external authentication.

This is pretty difficult to add in aws-amplify-react-native - which I'm guessing it why it's not a priority. If you've gone through the process of adding federated logins using https://github.com/AirLabsTeam/react-native-aws-cognito-js (which underpins the federated logins in aws-amplify), you can see that there are a bunch of things that need to happen outside of an imported library. Specifically, you need to add files and tweak config in both the ./ios and ./android directories. So not only would there be code necessary in this library, there would also likely need to be an additional tool that writes/edits the appropriate files. Which is not to say that it's impossible - just that it will take some time and finesse to get it right.

That being said, I'd love to see this feature too :)

For Facebook login, this will get you most of the way there: https://github.com/facebook/react-native-fbsdk

I will repeat my question, is there an ETA on this?

We don't currently have an ETA on this, it is in our backlog and a priority for us.

Hi, is there an update on the timelines?

this is supported now via amplify api in React Native. You can use the federatedSignIn method to pass in your social provider credentials and receive Cognito tokens (be sure your provider is configured in Cognito Federated Identities)

Was this page helpful?
0 / 5 - 0 ratings