A knowledge base article about OpenID Connect (OIDC) with Apache provided by the UC Berkeley IT Service Hub - Knowledge Portal
The Apache HTTP server can be configured to integrate with CalNet SSO. This is a convenient way to secure applications that do not have built-in support for various SSO protocols. The mod_auth_openidc authentication and authorization module is a modern and standards-based module for Apache that implements the OIDC Relying Party functionality.
mod_auth_openidc is recommended over both mod_auth_cas and mod_auth_mellon because it is standards based and generally easier to configure.
These are the high level steps to configuring mod_auth_openidc for Apache. Here is a simple working example.
# use auth-test for non-prod / QA systems
OIDCProviderMetadataURL https://auth-test.berkeley.edu/cas/oidc/.well-known/openid-configuration
# use auth.berkeley.edu for production systems or if you do not have non-prod / QA
OIDCProviderMetadataURL https://auth.berkeley.edu/cas/oidc/.well-known/openid-configuration
# Note that /secure/callback uri is managed by the mod_auth_openidc module and not created by you.
OIDCRedirectURI https://${YOUR_SERVER_FQDN}/redirect_uri
OIDCClientID ${YOUR_OIDC_CLIENT_ID}
OIDCClientSecret ${YOUR_OIDC_CLIENT_SECRET}
# This is a unique and strong passphrase generated by you to secure internal session cookies
OIDCCryptoPassphrase ${A_VERY_STRONG_AND_RANDOM_PASSPHRASE_HERE
OIDCScope "openid profile"
OIDCPKCEMethod S256
# OIDCRedirectURI is configured to point to /redirect_uri,
# so this location block handles the callback. It does not need to exist
# for real as it is handled by the security module.
<Location "/redirect_uri">
AuthType openid-connect
Require valid-user
</Location>
The following examples will make it so that your application redirects users for authentication.
<Location />
AuthType openid-connect
Require valid-user
</Location>
<Location "/example" >
AuthType openid-connect
Require claim "group~cn=edu:berkeley:official:employees:staff:professional.*$
</Location>