【问题标题】:Redirect Loop while using Apache mod auth openidc module使用 Apache mod auth openidc 模块时重定向循环
【发布时间】:2020-10-18 18:00:15
【问题描述】:

我们在连接到 Okta OIDC 的 Apache 服务器中使用了 mod auth openidc 模块。 登录到 okta 后 - 我们将多次重定向回重定向并再次返回 okta。 类似于以下问题:

如本期所述。 https://github.com/zmartzone/mod_auth_openidc/issues/181

我已确保 redirect_uri 与实际 url 页面加载 url 是分开的

My set up is exactly as below with a vanity redirection url which is protected 
# OIDCRedirectURI is a vanity URL that must point to a path protected by this module but must NOT 
point to any content
OIDCRedirectURI https://www.example.com/example/redirect_uri
OIDCCryptoPassphrase <password>

<Location /example/>
   AuthType openid-connect
   Require valid-user
   ProxyPass        backendangular/ 
   ProxyPassReverse backendangular/
</Location>

【问题讨论】:

    标签: apache httpd.conf mod-auth-openidc


    【解决方案1】:

    启用粘性会话

    当有两个带有负载平衡器的 apache 后端服务器时,我们面临着类似的连续循环重定向挑战。

    负载均衡器配置了轮询,第一台服务器进行了验证,但下一个请求转到另一台服务器,该服务器再次调用身份验证。

    我们修复了在负载均衡器上启用粘性会话的问题

    【讨论】:

      【解决方案2】:

      我们在 Apache 服务器前面有 CDN。 CDN 正在缓存所有内容,因此未正确设置 cookie。 CDN 尊重所有标头,例如来自 Apache 的 nocache 标头参数。

      像下面这样添加无缓存头解决了这个问题。

      filesMatch "\.(html|htm|js|css)$">
         FileETag None
          <ifModule mod_headers.c>
          Header unset ETag
       Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
       Header set Pragma "no-cache"
       Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
        </ifModule>
        </filesMatch>
      

      【讨论】:

        猜你喜欢
        • 2016-09-30
        • 2017-11-13
        • 1970-01-01
        • 2011-05-06
        • 1970-01-01
        • 2019-12-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多