Firebase - User oAuth2 sevice - Authorization code?

There is an application that wants to authenticate with my users using oAuth2.

Thus, they open a window with URL authorizeand parameters (such as uri redirection)

Like: https://my-website.com/api/authLauncherauthorize?redirect=SOME_URI

Now I have my own firebase-login, and when the user logs in, I get my access token from firebase. What I want to answer.

However, in the oAuth2 manual / explanations, for example https://aaronparecki.com/oauth-2-simplified/ I see that I have to return the authorization code, and I do not understand where can I get this?

What I can do is generate a fake code, associate it in the database with an access token, and then send the correct access token in the token request. Is that what I have to do?

Just to be clear, this is my first time writing an oAuth2 service.

+6
source share
2 answers

OAuth is a system that provides authenticated access to resources. This resource may be, for example, a user page or the rights to edit this user page. Thus, your goal is to provide access to permissions for the right people.

- , . , , , , - userdata base64 . , , , .

OAuth2 / . OAuth2 -.

:

  • -.
  • - OAuth2
+2

, -, , , :

  • - Github

  • Github, , ""

  • Github /authorize .

  • API ( github) .

  • API, . , , Auth. .

, , , , , API . , . firebase, , , : https://github.com/firebase/firebase-token-generator-node

: https://firebase.google.com/docs/auth/admin/#create_a_custom_token

, , , , , - , ( , ).

, google, - : https://developers.google.com/identity/protocols/OAuth2UserAgent#validatetoken

JWT - : https://jwt.io/

+1

All Articles