I am creating a registration / login stream for a website. I plan to use Facebook as my identity provider instead of riding on my own.
I am well versed in the server login stream using Facebook:
After these steps, I want to check if an already registered user is registered on my system. If so, simply return the newly created token to the user so that the user can make subsequent requests to the resource servers to access the protected data.
If the user is not registered in the system, I would like to register them by creating an entry in the database. Before creating this entry, I would like to receive from the user one piece of information. Namely, I would like them to tell me their desired "username". I will use this unique username as the primary database key.
I am not 100% sure about how to safely ask the user about the desired username before creating a record in the database. This is my question.:)
, " ". , , , . - :
code: {
mySecret: "super-secret-value",
expirationDate: "date-value",
user: { ... },
}
, , + , . + , mySecret, , . , user . , - .

. - , . SO, ( Facebook, Google ..). .