@DEPRECATED Get custom Google OAuth2 refresh token
This is step by step self explained tutorial. TODO(stepanic): implement it with few clicks as the part of web app.
1. Generate auth URL
serverless deployment @FirebaseFunctions
open in browser
URL from response at
authURLstarts with
https://accounts.google.com/o/oauth2/v2/auth/...





2. get refresh token from Authorization code
copy the whole redirect URL from address bar
starts with
http://localhost:4200/oauth2callback?code=
call Firebase function
https://europe-west1-firepixy-vjencanja.cloudfunctions.net/GET_REFRESH_TOKENin terminal (shell)
curl --location --request POST 'https://europe-west1-firepixy-vjencanja.cloudfunctions.net/GET_REFRESH_TOKEN/' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'redirectURLWithCode=<PASTE_HERE>'
get the value from the response at the field
refreshTokenand copy to the Firestore fieldgooglePhotosOAuthRefreshTokenat user document inuserscollection or at event document at sub-collectioneventsif you want specific custom Google Photos token per eventrefresh token lookup priority
if
eventhas use itelse if
userhas use itelse use global from environment variable
[email protected]account is global owner

3. Store the custom Google Photos refresh token at Firestore
Use custom Google Photos token for all user's events.

Use custom Google Photos token per specific event.

Last updated
Was this helpful?