-
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
Federated SignOut immediately signs back in and fails #4993
Comments
I've just hit what appears to be the same issue using |
Same problem on React Native. The auth events look sth like this: Hub.listen('auth', ({ payload: { event, data } }) => {
console.log(`event: ${event}`)
}); console log outputs:
|
I am having a similiar issue as listed above. As @ngtrhieu describes, the Alert is displaying Sign In when it is actually using the web browser of the device to call the url for the federated connection. I am not receiving the same error on the actual redirect page, as on my devices it just closes the web browser. Via the Hub, I am able to see that it is interpreting the first action as a "sign in" and then finishing with a a "sign out" after the browser has closed. Is there a manual way that we can call the endpoint programmatically so that the UI is not muddied up by this flow? My suggestion would be to implement a federatedSignOut function that will call the proper sign out URL for the social sign in. |
@sammartinez Can you explain how this is a feature request? Is there a way to make this function correctly now? |
I have faced same issue. Anybody figured out something new about it? I am on aws-amplify 3.1.1 and aws-amplify-react-native 4.2.5 and RN & Expo |
@sammartinez this an ongoing issue, can you take a look? |
@oguzhanali Did you ever find a solution for this? The documentation does a terrible job at explaining this |
If you were following Amplify docs when building your app then you have probably forgot to handle Checkout the docs https://docs.amplify.aws/lib/auth/social/q/platform/js#full-samples, lines 17-19. It worked for me :) Hope it helps somebody else too. |
I am having the same problem in Vue app where after using Google login I can't sign out properly. Calling Auth.signOut redirects to the cognito logout page (which is expected) but immediately tries to sign in again instead of redirecting to my application, as shown in the original post. |
For anyone else facing this issue, my problem was that the logout URL set in the cognito client and in my app were using different casing... It didn't seem to bother Cognito for the sign in callback but it wasn't happy with the sign out callback. |
I was able to reproduce this behavior with an older version of Amplify (aws-amplify": "^3.4.3") however as of V5, this doesn't appear to be happening. The underlying problem was most likely resolved at some point. If you come across this problem and are using an older version, please update and test again - however if you continue to face the problem after upgrading please open a new issue, thanks! |
Adding this code to the urlOpener method worked for me
|
Describe the bug
Federated auth calls cognito /logout successfully but then the app immediately calls /login which then fails with the error:
Required String parameter 'redirect_uri' is not present
To Reproduce
I'm just using the 'Full React Sample' code from https://aws-amplify.github.io/docs/js/authentication
with the following oauth config (which matches the Callback URLs and Sign out URLs config on the User Pool.
Clicking the 'Sign in' button works. Then clicking 'Sign out' does sign out but results in the
Required String parameter 'redirect_uri' is not present
error from cognito.Expected behavior
I would expect the app to remain in a logged out state and not to retry a login immediately.
Screenshots
This shows the network tab and the call out to /logout followed by /login
These are the redacted URLs
https://domain.auth.eu-west-2.amazoncognito.com/logout?client_id=clientid&logout_uri=http%3A%2F%2Flocalhost%3A3000
https://domain.auth.eu-west-2.amazoncognito.com/login?client_id=clientid&logout_uri=http%3A%2F%2Flocalhost%3A3000
https://domain.auth.eu-west-2.amazoncognito.com/error?client_id=clientid&logout_uri=http%3A%2F%2Flocalhost%3A3000
Logs
Ampliify DEBUG logs of the session as follows:
Environment
System:
OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
Memory: 737.01 MB / 15.58 GB
Container: Yes
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.9.4 - /usr/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
Browsers:
Chrome: 80.0.3987.122
Firefox: 73.0.1
npmPackages:
@testing-library/jest-dom: ^4.2.4 => 4.2.4
@testing-library/react: ^9.4.1 => 9.4.1
@testing-library/user-event: ^7.2.1 => 7.2.1
aws-amplify: ^2.2.5 => 2.2.5
aws-amplify-react: ^3.1.6 => 3.1.6
react: ^16.13.0 => 16.13.0
react-dom: ^16.13.0 => 16.13.0
react-scripts: 3.4.0 => 3.4.0
npmGlobalPackages:
@aws-amplify/cli: 1.6.8
babel-eslint: 10.0.1
eslint-config-airbnb: 17.1.0
eslint-plugin-import: 2.16.0
eslint-plugin-jsx-a11y: 6.2.1
eslint-plugin-react-hooks: 1.7.0
eslint-plugin-react: 7.12.4
eslint: 5.13.0
npm: 6.9.0
The text was updated successfully, but these errors were encountered: