Delete Cognito User by Username #3670
-
In V2, we could delete a Cognito user by using AWS.CognitoIdentityServiceProvider().adminDeleteUser({UserPoolId, Username}). I notice in V3, using CognitoIdentityClient, we can list ListIdentityPoolsCommand to get a Identity Pool Ids, and then ListIdentitiesCommand to get Identity Ids, and then DeleteIdentitiesCommand({IdentityIdsToDelete}) to delete the identities. But am I correct in thinking that these Identity Ids are not the same as the id (sub) used for Username? If I am correct, is there a way in V3 as there was in V2 to obtain and then delete a Cognito User by the Username as listed in the Cognito user pools console? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @pull-task I think you are looking for |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hey @pull-task I think you are looking for
AdminDeleteUserCommand
in V3.The API reference for it: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cognito-identity-provider/classes/admindeleteusercommand.html
Input should be
UserPoolId
and 'UserName`.Input: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cognito-identity-provider/interfaces/admindeleteusercommandinput.html