MOD_AUTH_OPENIDC是Apache 2.X HTTP服务器的OpenID认证™身份验证和授权模块,可实现OpenID Connect依赖派对功能。
该模块使Apache 2.x Web服务器能够作为OpenID Connect依赖方(RP)运行,向OpenID Connect Provider (OP)运行。它将最终用户身份验证传达给提供商,并从该提供商接收用户身份信息。然后,它将该身份信息(又称索赔)传递给受Apache Web服务器保护的应用程序,并为已确定的用户建立身份验证会话。
受保护的内容,应用程序和服务可以由Apache Server本身托管,也可以通过将Apache配置为这些服务器前面的反向代理来托管在其后面的原始服务器。后者允许将基于OpenID连接的身份验证添加到现有的应用程序/服务/SPA中,而无需修改这些应用程序,可能将它们从旧版身份验证机制迁移到基于标准的OpenID Connect on Single on(SSO)。
默认情况下,模块将REMOTE_USER变量设置为id_token [sub]索赔,并与OP的发行者标识符( [sub]@[iss] )串联。其他id_token索赔将在HTTP标头和/或环境变量中传递,以及从UserInfo端点获得的(可选)。提供的HTTP标头和环境变量可以由Apache服务器保护的应用程序消耗。
可以指定自定义的细粒授权规则(基于Apache的Require基础),以匹配id_token / userinfo索赔中提供的一组索赔,请参见此处。可以使用此处列出的支持的缓存后端选项之一来配置有关弹性和性能的聚类。
有关所有配置选项的完整概述,请参见文件auth_openidc.conf 。该文件还可以用作httpd.conf的包含文件。
MOD_AUTH_OPENIDC是OpenID认证™,并支持以下规格:
可以在Wiki上找到文档(包括经常询问的问题):
https://github.com/openidc/mod_auth_openidc/wiki
有关问题,问题和建议使用GitHub讨论论坛,请访问:
https://github.com/openidc/mod_auth_openidc/discussions
对于商业 - 基于订阅的 - 支持和许可,请联系:
[email protected]
示例配置用于在www.example.com和https://www.example.com/example/redirect_uri上使用Google作为您的OpenID Connect提供商,通过Google API控制台注册为客户端的Redirect_uri 。您还必须在Google API控制台中的APIs & auth下启用Google+ API 。
OIDCProviderMetadataURL https://accounts.google.com/.well-known/openid-configuration
OIDCClientID < your -client-id-administered-through-the-google-api-console>
OIDCClientSecret < your -client-secret-administered-through-the-google-api-console>
# OIDCRedirectURI is a vanity URL that must point to a path protected by this module but must NOT point to any content
OIDCRedirectURI https://www.example.com/example/redirect_uri
OIDCCryptoPassphrase < password >
< Location /example/>
AuthType openid-connect
Require valid-user
</ Location >请注意,如果您想将登录限制到特定的Google Apps域,您不仅会将hd=<your-domain>设置添加到OIDCAuthRequestParams ,以跳过Google帐户Chooser屏幕,还必须使用OIDCSCOPE索取email范围,并要求使用OIDCScope并要求使用“ oidcscope”的Location Require claim授权设置。
OIDCScope " openid email "
Require claim hd:< your -domain>以上是提供与字符串值的索赔确切匹配的授权示例。有关更多授权选项,请参见授权的Wiki页面。
mod_auth_openidc.so在您的apache服务器中AuthType openid-connect配置受保护的内容/位置OIDCRedirectURI设置为“虚荣” URL,该网址在受mod_auth_openidc保护的位置OIDCClientID和OIDCClientSecret中配置它们OIDCRedirectURI注册为重定向或回调URI,并向您的客户在提供商处OIDCProviderMetadataURL ,因此指向您在.well-known/openid-configuration端点上提供的OpenID连接提供商的发现元数据OIDCCryptoPassphrase中配置随机密码,以进行会话/状态加密目的 LoadModule auth_openidc_module modules/mod_auth_openidc.so
OIDCProviderMetadataURL < issuer >/.well-known/openid-configuration
OIDCClientID < client _id>
OIDCClientSecret < client _secret>
# OIDCRedirectURI is a vanity URL that must point to a path protected by this module but must NOT point to any content
OIDCRedirectURI https://< hostname >/secure/redirect_uri
OIDCCryptoPassphrase < password >
< Location /secure>
AuthType openid-connect
Require valid-user
</ Location >有关配置多个提供商的详细信息,请参见Wiki。
有关其他OpenID连接提供商的配置文档,请参见Wiki:
该软件由Zmartzone Holding BV的商业服务的子公司OpenIDC开放,您可以如上所述与OpenIDC联系。