how to specify the redirect url for the google sign-in button

15,560

Param name is data-redirecturi. Example:

<div class="g-signin2" 
   data-onsuccess="onSignIn"
   data-scope="https://www.googleapis.com/auth/plus.login"
   data-accesstype="offline"
   data-redirecturi="https://www.example.com/redirect_uri"></div>

Note that you don't have to set data-cookiepolicy, it's single_host_origin by default.

Share:
15,560
Afou Lazyboy
Author by

Afou Lazyboy

Updated on July 08, 2022

Comments

  • Afou Lazyboy
    Afou Lazyboy almost 2 years

    i was wondering how to specify the redirect url for a google sign-in button, here is the button:

     <div class="g-signin2" data-onsuccess="onSignIn"
        data-scope="https://www.googleapis.com/auth/plus.login
        https://www.googleapis.com/auth/userinfo.email
        https://www.googleapis.com/auth/userinfo.profile"
        data-requestvisibleactions="http://schemas.google.com/AddActivity"
        data-accesstype="offline"
        data-cookiepolicy="single_host_origin"></div>