question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hosted UI and /oauth2/authorize seem to auto login, without having the option to confirm ("continue"), or log in to a different account

See original GitHub issue

Describe the bug Neither: a) using the hosted UI and signing in with facebook/google https://my-app.auth.auth.us-west-2.amazoncognito.com/login?(...)

b) using the oauth login https://my-app.auth.auth.us-west-2.amazoncognito.com/oauth2/authorize?(...)

has the user confirm / continue, by presenting them with the common view found in most apps.

Approach b) has no way to switch to a different account after a user logs in with one, and are stuck. Both approaches will throw an error if a user removes access from the fb/google allowed apps, when you expect them to be re-prompted to continue and allow access.

To Reproduce Steps to reproduce the behavior:

  1. Create new account (e.g. ‘a@b.com’), then logout
  2. User wants to login as ‘b@c.com’). but there is no way to accomplish this with method b).
  3. If you skip 3, and the user deletes permissions on their identity provider, and tries logging in using method b, it does not ask you to re-login, and throws error. if using method a), and user hits continue, same error occurs.

Expected behavior If a user is logged in, provide the identity provider page that allows users to “Continue” as the currently signed in account, or to switch accounts.

If a user revokes permissions, show the same page, re-instilling them.

Screenshots screen shot 2018-09-19 at 10 08 14 pm

Smartphone (please complete the following information):

  • Device: iPhone X
  • OS: iOS 12
  • Browser Safari

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
raulmtcommented, Oct 24, 2019

I think this is still a problem. Auth.signOut() only signs out from Cognito, but not from the federated provider (Google in this case). So when you try to login again (in my case, using Auth.federatedSignIn({ .provider: 'Google' })) it will automatically bypass Google’s account selection/login and directly use the existing session.

One suboptimal solution to this is to also sign out from Google. You can accomplish this by making a GET request to https://accounts.google.com/logout. This way, a subsequent federatedSignIn will need to go through the Google login screen.

But, the ideal solution in my opinion is to enable passing the prompt query param when issuing the code flow. This way, when you know you are signed out, you could pass prompt=select_account and you will go through the google login screen even when you are still logged in in Google.

Can you please reopen this? It seems @powerful23 never got back with a Cognito team answer about this and it was just automatically closed

1reaction
ongteckwucommented, Nov 18, 2019

+1 would like to have a fix of this as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Amazon Cognito hosted UI for sign-up and sign-in
The Amazon Cognito Hosted UI provides you an OAuth 2.0 compliant authorization server. It includes default implementation of end user flows such as ......
Read more >
AWS Cognito - How to force select account when signing in ...
When I (AWS Congito) tried to reproduce the issue with Cognito Hosted UI, I had to re-sign in with Google after I signed...
Read more >
ADFS SSO troubleshooting - Windows Server | Microsoft Learn
Check if the Status of Active Directory Federation Services is Running. Then, check the external sign-in functionality using IdpInitiatedSignOn.
Read more >
Authentication - Expo Documentation
Expo can be used to login to many popular providers on iOS, Android, and web! ... Leverages the Hosted UI in Cognito (API...
Read more >
How to Use Client Credentials Flow with Spring Security
This access token is then used in the request to the other service for ... You can sign up for a free Okta...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found