-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native - Integrate User Pools with Federated Identities (FB login) #311
Comments
@dodomasta thanks for the detailed issue. Cognito User Pools federation is not currently supported. Amplify federation currently runs through Cognito Identity and these two do no link together. We do have support for Cognito User Pools hosted UI on our roadmap which we'll use this issue as tracking that also supports the social federation as well when using the hosted UI. Related to #45 |
Thanks for the update. |
Hi, Looking at 'Auth.federatedSignIn', the problem appear related to async cache, chaining the calls is working on my test with FB login. Hope this helps: ` * For federated login
Thx |
I don't think so, please have a look to the code i added in my post, i had
to add a 'if (Platform_1.default.isReactNative)...' branch of code (which
was not present) to handle the same logic flow already available for
'react' adapted to manage async cache implementation in react-native.
With this code i was able to have 'federatedSignIn' working fine on
react-native (tested with Facebook).
Feel free to ask if this is not clear, hope the code proposed be a
meaningful fix.
2018-03-09 22:34 GMT+01:00 Alexander Hansen <notifications@github.com>:
… If it is something with async cache then maybe it is related to:
facebook/react-native#14101
<facebook/react-native#14101> ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA2oJV6QlujiRsdbDp4Kq5Rh44i5C4rjks5tcvWBgaJpZM4SLI1->
.
|
@diegoneg I can get aws credentials based on the facebook token with your fix. But nothing is stored in Auth for amplify. So if I call Auth.currentSession or similar nothing is there. Do you experience that as well? Are you just signing in every time you need credentials? |
@alexanderbh guess you're right and my fix can be partial, I just tested credentials were ok, i will have a deeper look and let you know if i can propose a fix about Auth currentSession |
@mlabieniec Is there a way to generate a user from Cognito user pool directly within the federatedSignIn? As I understand current workaround is to recognise session of the user and then validate in the backend wheter token is issued from accounts.google.com or cognito endpoint? Thank you. |
Any update on the ETA for federated login HOC for React Native? |
@ganap we found some issues we need to work out within the core Auth class prior to completing the HOC for react native. Once we get past that we will complete / launch the hoc. |
Do you have a timeline on that ?
…Sent from my iPhone
On Apr 13, 2018, at 2:32 PM, Michael Labieniec ***@***.***> wrote:
@ganap we found some issues we need to work out within the core Auth class prior to completing the HOC for react native. Once we get past that we will complete / launch the hoc.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hello everyone, Any suggestions or workaround for this issue? I want to log in my react-native users using AWS Mobile Hub Cognito's federated identity (from active directory/SAML)? |
Hi, |
Hi, @mlabieniec, thanks for your work on this issue. Is there a beta build or branch the community can pull and integrate while you are working for a fix? Cheers Johnny |
@diegoneg Any news? |
apologize but didn't have time to complete it |
So just to confirm: It is currently impossible to use the federated logins feature for user pools on mobile. Is this correct? The docs clearly state that this is for mobile and web, yet web is the only one that can actually utilize it? Is there any hacky workaround without using identity pools? This is such a headache 😕 |
After reading this and a few other threads on GitHub and the AWS forums I am still confused about how to handle Sign In in a React Native app. Originally I developed my backend using developer authenticated identities with Cognito Federated Identities. After switching to React Native and AWS Amplify I read the Documentation, which states that Federated Identities are not supported in React Native. How will I be able to use the Users from my User Pool to access AWS resources in React Native? |
Will this pull request fix this issue? #878 |
You can now use federatedSignIn on React Native via API and send in the token from any of the providers. The PR you are referencing will provide actual react native components for google signin without needing to do yourself and pass the token. |
I used My understanding is that, before each API call, the AWS temporary credentials may need to be refreshed, and that Amplify is trying to do that under the hood when I call I may be missing something, or misunderstanding how the federated sign in flow is supposed to work. |
@mlabieniec I use federatedSignIn to login via FB on React Native but there is no user pool created, although a user was created in identity pool. |
@ttdat89 , you might have two copies of aws-amplify in your node_modules, extra from aws-amplify-react-native. If so, delete the extra one. You could also clear your yarn/npm cache, remove the node_modules and clean install all dependencies to get rid of the error. |
@nidsharm I have only one aws-amplify, I also try clear & reset cache, remove node_modules but it didn't help, there is no user in userpool after login via FB |
What is the status on React Native HOC for Federated Login (FB / Google) |
@phoenecke did you find a workaround? i'm having the same issue on react native + aws amplify + react-native-google-signin |
@dcoellarb I was just playing around with amplify and federated login, and I never really tried to build something real with it. I didn't do a lot of testing, but I think I ended up with something that seemed to work with google sign in and identity pool integration (I had no user pool involved). I think it is important to emphasize here, that Here is the
|
tks @phoenecke it definitely point me in the right direction, i don't love having to call Auth.federatedSignIn on every app load, but hey it works ;), so is good workaround for now, just fyi i could not use GoogleSignin.currentUserAsync i had to use GoogleSignin.signInSilently, maybe i'm using a different version. Tks again |
Repost: It is currently impossible to use the federated logins feature for user pools on mobile. Is this correct? The docs clearly state that this is for mobile and web, yet web is the only one that can actually utilize it? Is there any hacky workaround without using identity pools? This is such a headache 😕 |
Are you guys ever going to fix this for React Native? The documentation says it works for both React and React Native. But this pull request #878 is stuck in review for the last 3 months. |
I got this working on native for google by getting federatedInfo from the cache. This gives me access to the JWT token, but facebook login does not seem to store this. Big headache.. |
Yeah, I got Facebook logins working on React Native, but my only issue now is that the token seems to be expiring and give me an "Access Denied" on all my requests, until I re-auth with FB. It would be nice if it was handled the same way as the web sdk worked, where it automatically refreshed your tokens. Such a headache... |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.
Steps followed for react native app:
What is the expected behavior?
I'dexpect the the identity to be Facebook enabled and linked to the userPool user rather than unauthenticated.
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
The text was updated successfully, but these errors were encountered: