amazon-archives / aws-sdk-react-native

AWS SDK for React Native (developer preview)
Apache License 2.0
631 stars 68 forks source link

Cognito User Pool Authentication #46

Closed npalethorpe closed 6 years ago

npalethorpe commented 7 years ago

Hi, I'm hoping someone can shed some light on my somewhat confused brain. I recently decided to ditch an app I was originally writing using Cordova/AngularJS and start again using React Native. I had a fully implemented Cognito integration using the official aws amazon-cognito-identity-js library in my Cordova app. That worked great. However I'm now in a bit of a ditch trying to figure out how to integrate authentication with a user pool, not Facebook twitter etc as shown in the example.

If anyone could indicate if this is even possible using this id be very grateful, and more so if someone could give me a quick walkthrough on how to do it. I've been lost in web articles for days now and I'm on the fence about if its even possible. I'm considering attempting to implement the amazon-cognito-identity-js library however it uses localStorage and I'm unsure if that'll work with React Native.

Any help would be much appreciated.

npalethorpe commented 7 years ago

For anyone also interested in implementing AWS and the full Cognito functionality within React Native, I've managed to get it working, not using this library but instead using a mix of the React Native branch of the AWS SDK JS library and the Amazon Cognito Identity library - a hopefully easy to follow guide can be found at the following: https://github.com/aws/amazon-cognito-identity-js/issues/327

Hope that helps someone in the same situation as myself!

mnichols commented 7 years ago

I've implemented alot of the user pools functionality just by using the ios/android sdks directly and exposing in RN here : https://github.com/mnichols/react-native-aws-cognito-user-pools i just started extracting it out into a library so no docs yet but maybe it can help

undefobj commented 6 years ago

Please take a look at a new library that we released to help with this use case: https://github.com/aws/aws-amplify