【问题标题】:Keycloak/mod_auth_openidc under reverse proxy反向代理下的keycloak/mod_auth_openidc
【发布时间】:2019-10-01 06:47:19
【问题描述】:

我的 openid 有一个登录页面,如果尚未授权,它将重定向到 Keycloak,然后在验证后重定向到我的登录页面。 我在 Apache mod_proxy 下使用了我的 keycloak 服务器。

配置成功。现在,我的问题是,即使我的应用程序(Gitbucket 和 Jenkins)对我的 mod_auth_openidc 使用相同的领域,我仍然需要登录应用程序(SSO 设置),即使我在访问我的登录页面时已经过验证。请查看链接上的图片:https://ibb.co/VND01SY !https://ibb.co/VND01SY

    DocumentRoot "/var/www/html"
    DirectoryIndex index.html index. cgi index.php index.shtml

    <Proxy "balancer://apache_mod_proxy">
            BalancerMember "http://192.168.122.125:8080"
    </Proxy>

    ProxyPreserveHost On
    ProxyPass "/auth/" "balancer://apache_mod_proxy/auth/"
    ProxyPassReverse "/auth/" "balancer://apache_mod_proxy/auth/"

    OIDCProviderMetadataURL "http://192.168.122.103/auth/realms/ci/.well-known/openid-configuration"
    OIDCClientID "apache24"
    OIDCClientName "apache24"
    OIDCClientSecret "cc251291-9254-42ef-8073-6f5b396f73cc"
    OIDCScope "openid email profile"
    OIDCProviderTokenEndPointAuth "client_secret_basic"

    OIDCRedirectURI http://192.168.122.103/test/redirect_uri
    OIDCCryptoPassphrase 0123456789
    OIDCRemoteUserClaim "preferred_username"

    <Location /test>
       AuthType openid-connect
       Require valid-user
    </Location>

^这是我目前的配置。

我的预期输出应该是:

如果尚未通过 Keycloak 验证: 1. 访问 index.html -> 第一次登录时重定向到 Keycloak 2.验证后重定向到index.html(这里包含Jenkins和Gitbucket的链接) 3.点击应用链接后,无需重新登录同一个领域。

如果我对场景的理解正确,请纠正我。

我也不知道如何使用注销以及登录页面和 SSO 的注销位置。

【问题讨论】:

    标签: keycloak mod-auth-openidc


    【解决方案1】:

    到 Jenkins 和 Gitbucket 的 SSO 取决于如何配置这些应用程序以识别用户。它们应该配置为依赖于在其前面运行 mod_auth_openidc 的反向代理设置的标头。

    【讨论】:

    • 对不起,我不太明白第一个身份验证 [index.html -> keycloak] 如何无法识别第二层身份验证 [jenkins/gitbucket],即使我使用了相同的领域。是否应该在通过第一次身份验证后自动登录?我是否缺少此配置?谢谢
    猜你喜欢
    • 2019-05-06
    • 2019-07-05
    • 2020-05-20
    • 1970-01-01
    • 2017-07-09
    • 2017-12-01
    • 2019-11-04
    • 2017-03-16
    • 2016-09-16
    相关资源
    最近更新 更多