Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

oauth

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>
like image 787
Afou Lazyboy Avatar asked May 19 '15 18:05

Afou Lazyboy


People also ask

How do I redirect a specific URL?

Add a new URL redirectClick the URL Redirects tab. In the upper right, click Add URL redirect. In the right panel, select the Standard or Flexible redirect type. A standard redirect is used to redirect one URL to another.


1 Answers

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.

like image 132
Jarosław Gomułka Avatar answered Sep 25 '22 12:09

Jarosław Gomułka