Can we make username=sub?

0

I am using ForceAliasCreation and only required attribute is email for signup. User can sign in through preferred_username and email. But During sign-up it is asking a username that is not preferred_username & that is immutable. After email conformation user can chose their preferred_username. Now this is very odd that one user have 2 username one is immutable and other is mutable. Preferred username makes sense because user can change it later on.So I don't want to tell user that username required during signup instead I will make it equals to sub .Is it possible?

1개 답변
1
수락된 답변

Hello,

I understand your confusion regarding Cognito and the attributes required for a User. It is important to note that regardless of how you want the User to sign in or sign up for your User Pool, each user must have an immutable Username. That required Username serves as a unique identifier for each User in a User Pool.

preferred_username when not required is an alias, an attribute that can be used in place of the Username when signing in which is why it is easily changeable. Because Username is an immutable element that needs to be uniquely defined, I would not recommend redefining it to equal a static variable.

Feel free to reach out if you have any other questions.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠