如何为 google 登录按钮指定重定向 url [英] how to specify the redirect url for the google sign-in button

查看:86
本文介绍了如何为 google 登录按钮指定重定向 url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何为谷歌登录按钮指定重定向网址,这是按钮:

 

解决方案

Param name is data-redirecturi.示例:

请注意,您不必设置data-cookiepolicy,默认为single_host_origin.

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>

解决方案

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.

这篇关于如何为 google 登录按钮指定重定向 url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆