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聯繫。