【问题标题】:Google Authorized redirect URIsGoogle 授权的重定向 URI
【发布时间】:2016-05-20 05:36:01
【问题描述】:

假设我的应用的主域是https://www.example.com

应用程序将有很多实例,即

https://www.example.com/client1

https://www.example.com/client2

https://www.example.com/client3

<..>

为了对我的应用进行 OAuth2 身份验证,我目前有如下重定向 URI:

https://www.example.com/client1/SignInGoogle

https://www.example.com/client2/SignInGoogle

有没有办法为所有这些客户端添加一个授权重定向 URI?即

https://www.example.com/*

https://www.example/com/*/SignInGoogle

或者这个 URI 必须是 exact 匹配?

【问题讨论】:

    标签: redirect google-plus google-oauth


    【解决方案1】:

    如果您查看 Google 开发者控制台

    1. 必须有协议(HTTP / HTTPS)
    2. 不能包含 URL 片段 (#)
    3. 不能包含相对路径。
    4. 不能是公共 IP 地址。

    Relitve 与绝对 URI 的示例

    Relative URI    Absolute URI
    about.html      http://WebReference.com/html/about.html
    tutorial1/          http://WebReference.com/html/tutorial1/
    tutorial1/2.html    http://WebReference.com/html/tutorial1/2.html
    /                   http://WebReference.com/
    //www.internet.com/ http://www.internet.com/
    /experts/           http://WebReference.com/experts/
    ../                 http://WebReference.com/
    ../experts/         http://WebReference.com/experts/
    ./about.html    http://WebReference.com/html/about.html
    

    您想要做的是类似于相对 URI 的东西。您需要记住的是,身份验证服务器只不过是一种 Web 服务。如果您无法从普通 Web 浏览器访问重定向 URI,则身份验证服务器也无法访问。

    所以你不能这样做,它必须完全匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-28
      • 2020-02-29
      • 2015-08-09
      • 1970-01-01
      • 2019-01-07
      • 1970-01-01
      • 2023-01-01
      相关资源
      最近更新 更多