Firebase admin - get Google OAuth token

断了今生、忘了曾经 提交于 2020-07-10 10:26:27

问题


I have a web application where users can sign in with Google.

To the sign-in process, I add a scope to be able to access Google Calendar.

Now that the user is signed in, I would like to - in server-side - get their current Google access token in order to make a request and get a list of their events.

Is there a way to get the current OAuth token (no need for refresh token) in order for me to make this completely on the server-side?


回答1:


I'd say that you can check this article and put special attention to the recommendation for websites.

I understand you have configured already the consent screen, which is the first step of the basic steps on using OAuth 2.0. So I understand that you only have to perform the following steps:

  1. Obtain an access token from the Google Authorization Server
  2. Examine scopes of access granted by the user.
  3. Send the access token to an API

I think you can also give a look to this other doc for more GCP insights over your goal to authorize the request using user tokens



来源:https://stackoverflow.com/questions/62796830/firebase-admin-get-google-oauth-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!