jeudi 17 mars 2016

What password to store in database when user registers through OAuth2 (Example: google or facebook)?

I have a Web Application that permits user to register though a normal HTML Form, or via Facebook or Google. The question is what password should I store in the database, because even if the OAuth provider gives me relevant information like email, name, age, etc... It Obviously does not give you a password. What would be the correct password to store in Database? I have a few ideas:

  1. Generate a Random one and send it through email (Not very secure)
  2. Add an empty string. (They will never be able to login using a password because on acceptin login request I validate that password should contain more than 5 characters, this sounds like a very hacky way to do it)
  3. Make it compulsory to fill in a password after registering through OAuth provider.

Any Thoughts?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire