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

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

问题描述

我有一个使用 google api(google drive)的网络应用程序.该应用程序被许多客户端使用,每个客户端都有一个子域来访问系统.

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.

所以域是 appdomain.com

对于用户,我有 foo.appdomain.combar.appdomain.cometc.appdomain.com.

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

但是在 google 控制台重定向 URI 中,我必须手动放置重定向 url,有什么方法可以使用通配符重定向以使 google 接受任何子域,例如:*.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 ?

有了这个,我可以使用redirect_uri中的用户子域进行谷歌授权调用:

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

推荐答案

Google OAuth 不支持通配符匹配子域.您可以尝试使用 state 参数并在其中包含特定于用户的信息.此参数将在响应中返回给您.有关状态的更多信息此处.

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天全站免登陆