How to get refresh token for "Sign In With Google"

brohxa

I have been trying to create a refresh token since the access token keep on expiring in 1hr.

 window.onload = function () {
    google.accounts.id.initialize({
      client_id: ,
      callback: handleCredentialResponse,
    });

    google.accounts.id.renderButton(
      document.getElementById("google-signin-button"),
      { theme: "outline", size: "large", shape: "circle" } // customization attributes
    );
    google.accounts.id.prompt(); // also display the One Tap dialog
  };

In this doc from google nothing is mentioned about create a refresh token. https://developers.google.com/identity/gsi/web/guides/overview

Anyone help me out thanks.

DaImTo

Sign-in or authentication is login and returns and id token and an access token, and identifies the user behind the machine.

Oauth2 is authorization and returns an access token and refresh token granting your application access to a users data.

Signin will not return a refresh token.

If you read further on the page you linked you will fined a section intitled Separated Authentication and Authorization Moments

To obtain an access token for use with Google APIs, or to load some user data, you need to call the Google Identity Services authorization API instead. It's a separated JavaScript API, but packaged together with the authentication API.

Solution to your issue is to use Google Identity Services authorization API instead of signin to authorize a user using Oauth2.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how can I get refresh token

How to get a refresh token from an Aqueduct server

How to get Google drive refresh token automatically

How to get a refresh token from a service account

How to get bitbucket's refresh_token?

How I can get refresh token of fitBit

How to get Azure AD Refresh token with Postman?

How to use refresh token to get authorized in background and getting access token?

NodeJS, How to get new token with refresh token using google api?

How to get access token using refresh token AzureAD

Get refresh token with FOSOAuthServerBundle

Azure ADAL - How to get refresh token / how to refresh access token for nodejs backend server to server connection?

How to "sign in with Google" (id_token) *and* receive a code/access_token for specific scope (for the backend)

How to get offline token and refresh token and auto-refresh access to Google API

how to refresh access token with refresh token?

How to generate a refresh token?

How to secure a refresh token?

How to refresh token in Nestjs

How do I get a refresh token in Laravel Passport?

How to get refresh token in Linked In Oauth2?

How to get refresh token while using Google API JS Client

How can i get a Refresh token using the Salesforce OAuth?

How to get microsoft graph refresh token java sdk?

how do i get refresh token with each request?

How to get refresh token for google api using Firebase authentication

How to get REFRESH_TOKEN_AUTH request to return RefreshToken

How to get firebase last auth token Refresh time

How do I get a refresh token for command line gsutil to work?

How to get access tokens using refresh token automatically on oauth 2.0

TOP Ranking

  1. 1

    How can I create a column whose entries depend on the contents of a column in another table?

  2. 2

    pump.io port in URL

  3. 3

    How to display items using sessions

  4. 4

    BigQuery - concatenate ignoring NULL

  5. 5

    no applicable method for 'mutate_' applied to an object of class "c('integer', 'numeric')"

  6. 6

    How i extract text from a model dialog in selenium?

  7. 7

    x no applicable method for 'tbl_vars' applied to an object of class "c('double', 'numeric')"

  8. 8

    AirflowException: Celery command failed - The recorded hostname does not match this instance's hostname

  9. 9

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  10. 10

    Most efficient regex for checking if a string contains at least 3 alphanumeric characters

  11. 11

    using excel range find return Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

  12. 12

    redirect your computer port to url

  13. 13

    Can't create database with Symfony 4.1 : could not find driver

  14. 14

    How to fix "Exception evaluating SpringEL expression" error after submitting a variable Spring/Thymeleaf

  15. 15

    A python function to get the maximum value of a specific column, given a string that represents a table in CSV format

  16. 16

    Double spacing in rmarkdown pdf

  17. 17

    Uploading Files on production server returns either CORS error or POST 400 Bad Request using Apollo-Graphql

  18. 18

    Android Kotlin Unit test failing with io.mockk.MockKException: no answer found for

  19. 19

    Change Model input_shape but got an : ValueError: Input 0 of layer dense_44 is incompatible with the layer

  20. 20

    Formik, Yup - How to check is Decimal number

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive