Open ID Connect for Web Application (Apache Server)

Hi There,

My application is a Web Based and uses Apache Server, currently we are migrating to Open ID Connect.

I request can anyone help me out to onboard OIDC using Shell Script.

Thanks in advance.

If you are using mod_auth_openidc and Ubunutu, you can do something like this:


# Install Apache OIDC module
sudo apt-get update
sudo apt-get install libapache2-mod-auth-openidc

# Create OIDC configuration file
cat <<EOF > /etc/apache2/mods-available/auth_openidc.conf
OIDCClientID {yourClientId}

OIDCScope "openid name email"
OIDCRedirectURI https://your_apache_server/your_path/redirect_uri/
OIDCCryptoPassphrase <passwordToEncryptTheSessionInformationOnTheCookie>

<Location /protected>
   AuthType openid-connect
   Require valid-user

# Enable the Module
sudo a2enmod auth_openidc

# Restart Apache service
sudo systemctl restart apache2.service

The above example is based on a quickstart in the Auth0 docs, however mod_auth_openidc should work with any OIDC provider.