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的相对最新版本