T
T
tripcollor2019-03-16 21:45:58
API
tripcollor, 2019-03-16 21:45:58

Authorization through spa social networks, how to log in an existing user without a password?

On the backend is Laravel + oauth 2.0 (laravel pasport). I use vue js on the client.
I roughly understood how to register users, the client clicks on the button to go through, gives permission to read his data. I take this data basically only email and create it in the user database.
What is usually done in this case with a password? generate random and write?
Let's say the user was registered, I suppose I sent him an email with a generated password, he is too lazy to go in to look to change it, he clicks to authenticate through the social network, we receive the same mail that we have in the database in response, how to authenticate it now how to get a token via oauth?
upon initial registration, I get a token with a request like this:
grant_type: password
client_id: id
client_secret: secret
username: admin
password: secret
1) what to do with the password during the initial registration?
2) how to get a token knowing everything else except the password if the user is already recorded in the database?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question