Tom*_*mmy 2 apache mod-proxy mod-auth-openidc
我有一个在 apache 2.2 上运行的基本 Web 应用程序,没有任何身份验证。网站内容是静态网页。
我们的小组织目前正在致力于为所有网站实施mod_auth_openidc 。我想在基本静态 Web 应用程序之上
实现mod_auth_openidc身份验证。
我怎样才能实现它?我是 apache 配置和mod_auth_openidc
的新手。我在谷歌上搜索了一些文章来实现它,但我找不到任何文章。我在 Oauth2 服务器上为我的应用程序创建了一个静态帐户。
有人可以指出如何使用mod_auth_openidc和mod_proxy配置为我的静态网页应用程序启用身份验证的正确方向吗?
<Location />
AuthType openid-connect
Require valid-user
</Location>
OIDCProviderMetadataURL https://example.com/fss/.well-known/openid-configuration
OIDCClientID ExampleCorp_Prod_web01
OIDCClientSecret <client-secret>
OIDCRedirectURI http://<ip>/redirect_uri
OIDCScope "profile openid"
OIDCCryptoPassphrase example@3003
OIDCCookiePath /
ProxyPass / http://<ip>:8080/ nocanon
ProxyPassReverse / http://<ip>:8080/
ProxyRequests Off
AllowEncodedSlashes on
<Proxy http://<ip>:8080/*>
</Proxy>
OIDCAuthNHeader X-Forwarded-User
OIDCRemoteUserClaim sub
OIDCClaimPrefix example_
LoadModule auth_openidc_module modules/mod_auth_openidc.so
Run Code Online (Sandbox Code Playgroud)
Github 项目页面上的自述文件中有示例: https: //github.com/zmartzone/mod_auth_openidc。假设静态网页位于/example
,在您的特定 (PingFederate) 示例中,它将类似于:
OIDCProviderMetadataURL https://<pingfederate-host>:9031/.well-known/openid-configuration
OIDCClientID <client-id-as-registered-with-pingfederate>
OIDCClientSecret <client-secret-as-registered-with-pingfederate>
OIDCRedirectURI https://<your-apache-host>/example/redirect_uri/
OIDCCryptoPassphrase <password>
OIDCScope "openid email profile"
<Location /example/>
AuthType openid-connect
Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)
基于OPs环境的完整工作示例:
Listen 80
User www
Group www
DocumentRoot /opt/local/apache2/htdocs/
ErrorLog "logs/error_log"
LogLevel info
ServerName example.org
LoadModule ssl_module modules/mod_ssl.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule auth_openidc_module modules/mod_auth_openidc.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<Location />
AuthType openid-connect
Require valid-user
</Location>
OIDCProviderMetadataURL https://accounts.google.com/.well-known/openid-configuration
OIDCClientID myclientid
OIDCClientSecret mysecret
OIDCRedirectURI http://example.org/protected/
OIDCScope "profile openid"
OIDCCryptoPassphrase example@3003
OIDCCookiePath /
ProxyPass / http://192.168.10.1:80/ nocanon
ProxyPassReverse / http://192.168.10.1:80/
ProxyRequests Off
AllowEncodedSlashes on
<Proxy http://192.168.10.1:8080/*>
</Proxy>
OIDCAuthNHeader X-Forwarded-User
OIDCRemoteUserClaim sub
OIDCClaimPrefix example_
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8400 次 |
最近记录: |