as written in the title is it possible change username of a Amazon Cognito user? I can't find anything in documentation
The information in this topic is specific to projects based on .NET Framework and the AWS SDK for .NET version 3.3 and earlier. Using Amazon Cognito Identity, you can create unique identities for your users and authenticate them for secure access to your AWS resources such as Amazon S3 or Amazon DynamoDB.
Once you have created a user pool for user management or an identity pool for federated identities or sync operations, you can download and integrate the AWS Mobile SDKwith your app. Alternatively you can call the Cognito server-side APIs directly, instead of using the SDK. See our developer guidefor more information.
Download the Mobile App Amazon Cognito FAQs General Add User Signup & Sign-in to your mobile and web apps Federate identities and provide secure access to AWS resources Store and Sync Data Across Devices Pricing Get Started with Amazon Cognito General Q: What is Amazon Cognito?
For a walk-through on getting started with iOS, please visit this blog. Before you can use the SDK, you must create a user pool. 1) Start by signing in to the Amazon Cognito console and choosing Manage your User Pools. This opens the page where you can see all of your Cognito user pools and also create new pools.
It is possible to update the preferred_username
of a Cognito User using the iOS SDK, using the updateAttributes
API call. However, kindly note that you would not be able to modify the username
of a user. Quoting the official AWS documentation,
The username value is a separate attribute and not the same as the name attribute. A username is always required to register a user, and it cannot be changed after a user is created.
But, the preferred_username
value can indeed be changed, and a sample code to change the preferred username using the iOS SDK, as per the official documentation is stated as follows:
AWSCognitoIdentityUserAttributeType * attribute = [AWSCognitoIdentityUserAttributeType new];
attribute.name = @"preferred_username";
attribute.value = @"John User";
[[user updateAttributes:@[attribute]] continueWithSuccessBlock:^id _Nullable(AWSTask<AWSCognitoIdentityUserUpdateAttributesResponse *> * _Nonnull task) {
//success
return nil;
}];
I would also like to state that the AWS API documentations for the iOS SDK are rather minimal, and I would recommend developers to go through the SDK source code whenever in doubt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With