Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 授权请求的动态查询参数_Apache_Authentication_Openid_Mod Auth Openidc - Fatal编程技术网

Apache 授权请求的动态查询参数

Apache 授权请求的动态查询参数,apache,authentication,openid,mod-auth-openidc,Apache,Authentication,Openid,Mod Auth Openidc,您好,我想配置apache2服务器,将未经授权的用户重定向到我的提供商登录页面,如google、glu等。。我使用的是mod\u auth\u openidc和下面的代码片段我的default ssl.conf文件 <IfModule mod_ssl.c> <VirtualHost _default_:8443> OIDCProviderMetadataURL https://<my_provider>/.well-known/open

您好,我想配置
apache2
服务器,将未经授权的用户重定向到我的提供商登录页面,如
google
glu
等。。我使用的是
mod\u auth\u openidc
和下面的代码片段我的
default ssl.conf
文件

<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>

OIDCProviderMetadataURLhttps:///.well-known/openid-configuration
舌苔
OIDClientCret
OIDCRedirectURI https://:8443/cgi-bin/
#OIDCAUTHREQUESTPARMS acr_values=auth_request_参数
自动应答器类型代码
OIDCcope“openid配置文件电子邮件”
OIDCSSL验证服务器关闭
OIDCCryptoPassphrase 123456
莱姆萨斯环境
OIDCClaimPrefix用户信息_
OIDCPassIDTokenAs有效负载
需要有效用户
AuthType openid连接
服务器管理员webmaster@localhost
DocumentRoot/var/www/html
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
斯伦金安
SSLCertificateFile/etc/apache2/ssl/apache.crt
SSLCertificateKeyFile/etc/apache2/ssl/apache.key
发展+标准
发展+标准
现在有了这个配置,一切都好了。当我进入我的站点时,apache将我重定向到OP登录页面。我有3种身份验证机制,我的提供商根据请求中的
acr\u值和
ui\u地区的显示语言决定必须加载哪个登录页面。为此,我应该将此参数传递给auth requset url。但是用
mod\u auth\u openidc
我做不到。我可以静态设置
OIDCAuthRequestParams
,但这并不能解决我的问题,因为登录机制和语言取决于用户的选择

我阅读并使用下面的链接。但它不起作用。我不知道我可能误解了什么

[my_site]?target_link_uri=[my_site/mypage.html]&iss=[my_provider]&auth_request_params=[urlencoded查询字符串]


这不对吗?如何传递动态
acr_值
ui_区域设置
,以便apache使用这些查询参数生成身份验证请求

您可以通过重定向
OIDCRedirectURI
并提供
身份验证请求参数
target\u link\u uri
iss
。例如

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
https://:8443/cgi-bin/?target\u-link\u-uri=[my\u-site/mypage.html]&iss=[my\u-provider]&auth\u-request\u-params=acr\u值%3Dsome\u-acr%26ui\u-locales%3Den

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

确实可以通过重定向
OIDCREDICTURI
来显式触发身份验证请求,并提供
auth_request\u参数以及
target\u link\u uri
iss
。例如

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
https://:8443/cgi-bin/?target\u-link\u-uri=[my\u-site/mypage.html]&iss=[my\u-provider]&auth\u-request\u-params=acr\u值%3Dsome\u-acr%26ui\u-locales%3Den
当您与单个提供商一起使用它时,您确实需要使用mod_auth_openidc>=2.3.0的相对最新版本