-
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
How to handle Oauth returns? #1395
Comments
I'm also having this issue with the aws Hosted UI oauth page. After login, it redirects back to my app with the Code Grant (also tried Implicit Grant). Amplify seems to make the backend calls to validate the token and succeeds. However all the APIs say that the user is not authenticated. |
@yuankunluo I think there's a fix here #1386 |
+1 |
@jadbox , thank you , your code solved my problem. I follow these steps to add Azure AD (Office 365's User Directory) as an Identity Provider to my Cognito User Pool. https://www.idea11.com.au/how-to-set-up-aws-cognito-federation-office365/ After successfully redirect to my localhost from AWS Cognito, i got the grant code. The Angular Component i wrote to handle this returns looks like your code: ) @component({ constructor( ngOnInit() { } onHubCapsule(capsule: any) { ` Thank you for you help @jadbox , hope the Amplify Doc will have more details about this topic. |
hi @yuankunluo |
This issue shouldn't be closed. Even though there is a workaround, it's not a final fix. Instead of listening to the amplify events, all the promises use to check if there is a valid session should be resolved until a sign-in event has been triggered in order to be more accurate. How to do it? there is a code flow event that is triggered when the hosted UI redirects the user to the app. From there Amplify could know that there is a request on going to get the new tokens. Use case: In Angular, guards are use to validate rounds, it;s usual that you place your code to check if there is a valid session to make sure that only authenticated user can see those. |
Is it possible to initiate the social login protocol on a new tab and listen on Hub for the change of auth state? Thanks in advance |
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 |
Hi there, my company is working on an enterprise App, which allows our employees to sign in. Our employees are on Office 365 which I have already configured correctly use Cognito User Pool with SAML.
Cognito redirects the user back to my angular app with this url:
http://localhost:4200/authenticated?code=[some authenticate by code grant code flow]
Is there any way to make Amplify aware this successful sign in?
I have tried so many ways including use aws-cognito-auth-js to parse this url, but i can't inject this session into amplify.
Anyone can help? thank you
The text was updated successfully, but these errors were encountered: