How to use preferred username to login a user?

0

I am trying to use forcealiasatribute by which user can login through preferred username. Email is the only attribute required for sign up but in Amplify.Auth.SignUp() it is asking for username.But I want that username should be a random "sub"(example:"151af027-eede-423f-b17e-3d94908717s2"). Now(This is happening):

  1. Username: entered through Amplify.Auth.SignUp() function and it must be unique.(I want this should be a random string like below sub and not entered by user)
  2. Sub: 151af027-eede-423f-b17e-3d94908717s2 it is also unique.
  3. Preferred username: updated through attribute update function it is also unique. I WANT THIS:
  4. Username:151af027-eede-423f-b17e-3d94908717s2
  5. Preferred username: updated through attribute update function(it should be unique)
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions