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)
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen