Open ID Connect for Web Application (Apache Server)

Hi There,
Greetings!

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.
Hanumesh

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

#!/bin/bash

# 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
OIDCProviderMetadataURL https://your-okta-domain.com/oauth2/default/.well-known/oauth-authorization-server
OIDCClientID {yourClientId}
OIDCClientSecret 'YOUR_CLIENT_SECRET'

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

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

# 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.