Hi @Shah Mita (YIANA) , can you please follow these steps and let me know if they work for you? If not it'll help narrow down the issue. It seems like you've already followed some of these steps, but in case you didn't:
- Download the mod_auth_openidc module from the GitHub repository.
- Extract the downloaded ZIP file to a directory on your server.
- Copy the
mod_auth_openidc.so
file to the Apachemodules
directory. - Add the following lines to your Apache configuration file to load the module:
LoadModule auth_openidc_module modules/mod_auth_openidc.so
- Configure the module by adding the following lines to your Apache configuration file:
ReplaceLocation /oauth2callback AuthType openid- Require valid-user LogLevel debug /Location OIDCProviderMetadataURL https://login.microsoftonline.com/{tenant}
{tenant}
with your Azure AD tenant ID,{client-id}
and{client-secret}
with the client ID and secret of your Azure AD application,{your-apache-server}
with the hostname of your Apache server, and{passphrase}
with a passphrase of your choice. Restart Apache to apply the changes.
With mod_auth_openidc configured, Apache will redirect users to the Azure AD login page when they try to access a protected resource. After the user logs in, Azure AD will redirect the user back to Apache with an ID token. Apache will then validate the ID token and set the REMOTE_USER
environment variable to the user's email address.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James