Replies: 6 comments
-
I think the SDK client must load IAM credentials with at least the permission to be able to do the GlobalSignOut on users.
|
Beta Was this translation helpful? Give feedback.
-
Hi, Cognito UserPool users are able to self-register (sign-up) and then login (password) when needed (with initiateAuth through cognitoClient). These users, IMHO, have no IAM access credentials. But it is obvious that they should have possibility to force logout their auth session at anytime (Amplify JS SDK has Sign-Out method for it). I thought that I should use GlobalSignOut method in AWS Java 2 SDK, but if it requires IAM credentials, it is not what I need. Is there any other API method to implement UserPool users self-logout (sign-out) to kill current auth session (make its accessToken not valid anymore). At that. I expect this method to return error if the specified current session/accessToken has already expired to notify client app users. |
Beta Was this translation helpful? Give feedback.
-
@nilyin I don't think
but I'm not 100% sure, I'm not familiar with Cognito and this is mostly a service question... If the sign-out flow is not what you need, let us know and I'll see if I can reach out to the Cognito team. |
Beta Was this translation helpful? Give feedback.
-
I'm also moving this to Github discussion, because it's not really a bug. |
Beta Was this translation helpful? Give feedback.
-
@debora-ito hi, I don't think that SAML (3rd party auth IdP) is acceptable in my use case. My backend is fully based on Amplify (Cognito+AppSync), it means my users are Cognito UserPool users, fully managed by Cognito auth service without need of additional external SAML service. Amplify provides client SDK for web/js and mobile apps (Android/iOS) which has UserPool user self sign-up, sign-in and sign-out API. But for Java client application I have to use AWS Java 2 SDK for Cognito. In my case the users are created in Amplify (actually in Cognito UserPool) through my web portal sign-up. I have successfully made existing user sign-in from my Java client app and received the accessToken for further AWS AppSync/S3 requests, but can't find API to sign-out the user and disable the previously received accessToken. Could you please consult with Cognito team for advice (or sample code) on how can I accomplish UserPool' user self sign-off. |
Beta Was this translation helpful? Give feedback.
-
Hi, after studying this documentation link below it looks like https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/cognitoidentityprovider/CognitoIdentityProviderClient.html#globalSignOut(software.amazon.awssdk.services.cognitoidentityprovider.model.GlobalSignOutRequest) but it doesn't. I'll try to debug it deeper. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hi, I am trying to make graceful logout for Cognito userPool user with existing auth session using the code below:
Expected Behavior
I am expecting to catch the case when an accessToken has already expired to notify a user
I expect that the provided accessToken is used and only that, without trying to find other credentials in the system
Current Behavior
I currently receive multiple error messages:
which is followed by:
it looks like the SDK client is trying to load IAM credentials instead of userPool' ones..
Reproduction Steps
just repeat the given piece of code
Possible Solution
not found
Additional Information/Context
I am using quarkus 2.16.6.Final
AWS Java SDK version used
2.20.74
JDK version used
11.0.2 2019-01-15 LTS
Operating System and version
MACOS 13.4 (22F66)
Beta Was this translation helpful? Give feedback.
All reactions