如何为带有Google OAuth 2的模式设置重定向URI? [英] How to set redirect URI with pattern for OAuth 2 with Google?

查看:176
本文介绍了如何为带有Google OAuth 2的模式设置重定向URI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望多个网站使用相同的Google帐户进行oAuth身份验证.网站是动态生成和部署的,并且遵循相同的路径模式.因此,每个网站的重定向URI都会发生变化,并且每个URL都无法单独添加到Google开发者控制台中.是否可以添加任何模式或目录作为重定向URI.

I want to have multiple websites using same google account for oAuth authentication. The websites are generated and deployed dynamically and follows a same path pattern. So the redirect URI will change for each website and each URL individually cannot be added in Google developer console. Is it possible to add any pattern or directory as redirect URI.

wwww.domain.com/demo/<number>/oauth/google.html  

How can I keep <number> dynamic in the redirect URI?

推荐答案

是否可以添加任何模式或目录作为重定向URI?

否.

您将需要实现Google重定向到的代理,然后将其重定向(或发布)到实际的oauthhandler.

You'll need to implement a proxy that Google redirects to which in turn redirects (or posts) to the actual oauthhandler.

NB将xxxx.html作为您的重定向URL是不寻常的,因为它通常是某种服务器逻辑(Java servlet,php页面等).您确定您已了解重定向URl在做什么吗?

NB Having xxxx.html as your your redirect URL is unusual as it would normally be some sort of server logic (a Java servlet, php page, etc). Are you sure you've understood what the redirect URl is doing?

这篇关于如何为带有Google OAuth 2的模式设置重定向URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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