【问题标题】:oAuth2 redirect with http protocol instead of https protocaloAuth2 使用 http 协议而不是 https 协议重定向
【发布时间】:2018-12-20 00:31:26
【问题描述】:

根据我的部署架构,oAuth2 服务器使用 http 协议运行。客户端使用 https 协议向 F5 交换机请求,F5 交换机会将此调用转发给使用 http 协议的 oAuth2。没关系,我从 oAuth2 服务器获得登录页面。但问题是当使用http协议执行登录oAuth2重定向时,它应该是https协议。

例如: 转到登录页面网址是: 请求网址:https://192.144.80.117:10900/authentication-service-provider-1.0/login

结果:获取登录页面

提供登录信息(用于测试目的的凭据错误)并单击提交。 它应该返回:https://192.144.80.117:10900/authentication-service-provider-1.0/login?error

但它返回:http://192.144.80.117:10900/authentication-service-provider-1.0/login?error

【问题讨论】:

    标签: spring oauth-2.0 spring-security-oauth2


    【解决方案1】:

    我也遇到过类似的问题,通过设置解决了

    server:
      use-forward-headers: true
    

    在我的 applications.yml 中。

    供参考:

    Stackoverflow: Spring OAuth redirect_uri not using https

    SpringBoot Docs: How to use Tomcat behind a proxy server

    【讨论】:

    • 感谢您的回答,但我已经在 application.properties 文件中使用了此 (server.use-forward-headers=true) 属性。结果一样。有什么别的想法!
    • 我稍微改变了我的架构。 oAuth2 服务器以 https 模式启动。但这是一种解决方法。
    猜你喜欢
    • 2011-02-22
    • 1970-01-01
    • 2013-10-22
    • 2012-05-27
    • 2011-12-03
    • 2019-04-27
    • 2020-04-16
    • 2013-06-20
    • 1970-01-01
    相关资源
    最近更新 更多