Google Accounts - OpenIDC/mod_auth_openidc GitHub Wiki
Sample configuration for using Google as your OpenID Connect Provider running on
www.example.com and https://www.example.com/example/redirect_uri registered
as the redirect_uri for the client through the Google Cloud console. Create an OAuth 2.0
Client ID of type "Web application" under APIs & Services > Credentials in the
Google Cloud console and configure the
OAuth consent screen. (Older versions of this page told you to enable the Google+ API; that
API was shut down in March 2019 and is neither available nor needed - the standard OpenID
Connect userinfo endpoint serves the profile claims.)
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>Note if you want to securely restrict logins to a specific Google Apps domain you would not only
add the hd=<your-domain> setting to the OIDCAuthRequestParams primitive for skipping the Google Account
Chooser screen, but you must also ask for the email scope using OIDCScope and use a Require claim
authorization setting in the Location primitive similar to:
OIDCScope "openid email"
Require claim hd:<your-domain>The above is an authorization example of an exact match of a provided claim against a string value. For more authorization options see the Wiki page on Authorization.