android and "server" outh keys gcloud

Viewed 18

I have android and ios OAuth2.0 Credentials for authenticating with outh2.0, I do get my access and refreshtokens. I store the refreshToken .

Then in a django server I try to get a new access_token with above refresh token by posting to https://accounts.google.com/o/oauth2/token using new Auth2.0 Credentials for a web app.

params = {
            "grant_type": "refresh_token",
            "refresh_token":  user_refresh_token,
            "token_uri": authorization_url,
            "access_type": "offline",
            "client_id": client_id,
            "redirect_uri": "https://www.googleapis.com/oauth2/v4/token",
            "client_secret": client_secret,

        }

errorThe credentials do not contain the necessary fields need to refresh the access token. You must specify refresh_token, token_uri, client_id, and client_secret

The access token is then used to get creds and access user calendar.

creds = google.oauth2.credentials.Credentials(access_token)
        service = build('calendar', 'v3', credentials=creds)

Note the keys are for the same project.

Is there a way to use a service account to get a refresh token ?

Can I use different oAuth credentials for the same project?

Can I "merge"/"mix" the clients?

What can I do to get a refresh token with the web App Credentials?

0 Answers
Related