Google控制台重定向URI中的子域 [英] Subdomain in Google Console Redirect URIs

查看:121
本文介绍了Google控制台重定向URI中的子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用谷歌API(谷歌驱动器)的网络应用程序。该应用程序被许多客户端使用,每个客户端都有一个子域来访问系统。



所以该域名是 appdomain.com



对于我有 foo.appdomain.com bar.appdomain.com etc.appdomain的用户。但在谷歌控制台重定向URI我必须手动把重定向的URL,有没有什么办法,我可以使用通配符重定向,使谷歌接受

任何子域名如:* .appdomain.com?



借助此功能,我可以在redirect_uri中对用户子域名进行Google授权调用:

  https://accounts.google.com/o/oauth2/auth?redirect_uri=http://foo.appdomain.com 

您可以尝试使用状态参数并在其中包含用户特定的信息。该参数将在响应中返回给您。
有关州此处的更多信息。


I have an web application that uses google api (google drive). The application is used by many clients and every client has an subdomain to access the system.

So the domain is appdomain.com

And for users I have foo.appdomain.com, bar.appdomain.com, etc.appdomain.com.

But in google console redirect URI I have to manually put the redirect urls, is there any way I can use wildcards to redirect to make google accept any of subdomains like: *.appdomain.com ?

With this I can make the google authorization calls with the user subdomain in redirect_uri:

https://accounts.google.com/o/oauth2/auth?redirect_uri=http://foo.appdomain.com

解决方案

Wildcard matching subdomains is not supported in Google OAuth. You could try using the state parameter and include the user-specific information there. This parameter will be returned to you in the response. More information on state here.

这篇关于Google控制台重定向URI中的子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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