C
C
Cyril2017-12-05 17:49:12
MySQL
Cyril, 2017-12-05 17:49:12

What fields in the table should be for OAuth2.0 authorization?

There was a need to make the web application so that users could log into their personal account using a VKontakte and Facebook account . As far as I know, both social networks support OAuth 2.0 authorization protocols.
All users in the web application are contained in the user table . Can you please tell me what additional fields need to be added to this table in order to provide OAuth 2.0 in a web application?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2017-12-05
@thewind

In this matter, you should think logically - look at how oauth works. Initially, its purpose is to give you an access_token to access API functions. At the same time, along with the token, you are given a user_id. So they need to be stored so as not to request a token every time, but to use it after receiving it.
But the token has the "expire" property. Therefore, you will also be given the value of expired_in and refresh_token, they must also be stored so that when the token expires, it can be updated using refresh_token.
user_id is needed to match your internal id and external id in another network.
Well, something like this...

K
kidar2, 2017-12-05
@kidar2

You don't have to store anything. As soon as the user's session in your application has expired, he will still be re-authorized. All you need to receive from the authorization service is an email, and compare it with your database in order to understand who to authorize under.
There is no need to store any tokens or expired_in.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question