【问题标题】:Dynamic query parameters for the authorization request授权请求的动态查询参数
【发布时间】:2017-10-18 08:00:31
【问题描述】:

您好,我想配置apache2 服务器以将未经授权的用户重定向到我的提供商登录页面,例如googlegluu 等。我正在使用mod_auth_openidc 和下面的代码sn-p my @ 987654326@文件

<IfModule mod_ssl.c>
    <VirtualHost _default_:8443>
        OIDCProviderMetadataURL https://<my_provider>/.well-known/openid-configuration
        OIDCClientID <client_code>
        OIDCClientSecret <client_secret>
        OIDCRedirectURI https://<my_site>:8443/cgi-bin/
        #OIDCAuthRequestParams acr_values=auth_request_params
        OIDCResponseType code
        OIDCScope "openid profile email"
        OIDCSSLValidateServer Off
        OIDCCryptoPassphrase 123456
        OIDCPassClaimsAs environment
        OIDCClaimPrefix USERINFO_
        OIDCPassIDTokenAs payload
        <Location "/">
            Require valid-user
            AuthType openid-connect
        </Location>


        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        SSLEngine on

        SSLCertificateFile /etc/apache2/ssl/apache.crt
        SSLCertificateKeyFile /etc/apache2/ssl/apache.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
    </VirtualHost>
</IfModule>

现在有了这个配置,一切都OK了。当我进入我的站点时,apache 将我重定向到 OP 登录页面。我有 3 种身份验证机制,我的提供商决定必须加载哪个登录页面取决于 acr_values 和来自请求的 ui_locales 参数的显示语言。为此,我应该将此参数传递给 auth requset url。但是mod_auth_openidc 我做不到。我可以静态设置OIDCAuthRequestParams,但这并不能解决我的问题,因为登录机制和语言取决于用户的选择。

我阅读了this documentation 并使用以下链接。但它不起作用。不知道是不是我理解错了。

[my_site]?target_link_uri=[my_site/mypage.html]&iss=[my_provider]&auth_request_params=[urlencoded-query-string]

错了吗?如何传递动态acr_valuesui_locales 以便apache 使用这些查询参数生成身份验证请求

【问题讨论】:

    标签: apache authentication openid mod-auth-openidc


    【解决方案1】:

    您确实可以通过重定向OIDCRedirectURI 并提供auth_request_params 参数以及target_link_uriiss 来显式触发身份验证请求。例如。

    https://<my_site>:8443/cgi-bin/?target_link_uri=[my_site/mypage.html]&iss=[my_provider]&auth_request_params=acr_values%3Dsome_acr%26ui_locales%3Den
    

    当您将它与单个提供商一起使用时,您确实需要使用相对较新的 mod_auth_openidc >= 2.3.0 版本

    【讨论】:

      猜你喜欢
      • 2019-11-18
      • 1970-01-01
      • 2014-04-08
      • 2015-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 1970-01-01
      相关资源
      最近更新 更多