How to Integrate Outlook Authentication with Horilla HRMS on Azure

In the modern digital world, providing safe and smooth communication through HR management systems is vital. Integration of email is important in order to make HR operations smooth and efficient, providing automated reminders, and allowing smooth and easy interaction between employees and top managers. Horilla HRMS is a powerful HR management tool that provides Outlook authentication to provide extra security and compliance with enterprise email standards.
This tutorial shall lay down step-by-step procedures for integrating Outlook authentication with Horilla HRMS through Azure in order to achieve a secure and hassle-free email communication process.
Step 1: Host Horilla with SSL
Before integrating Outlook authentication, it is crucial to ensure that Horilla HRMS is running over SSL (Secure Sockets Layer). SSL encrypts data transmitted between the server and clients, preventing unauthorized access or tampering by malicious entities.
Microsoft Outlook and Azure services require secure HTTPS communication for authentication and API requests. Without SSL, your application may encounter authentication failures, as Microsoft enforces strict security policies to protect sensitive data, including email credentials and access tokens.
Step 2: Login to Azure Portal
Visit the Azure Portal and log in with your Microsoft account.
Step 3: Register an Application in Azure
Navigate to the Azure Active service section in the portal and search for app registration. Click on App registrations.

Click New Registration.

Then fill out the form

Provide an application name and select the supported account types.
Here I’m going with the “Accounts in any organizational directory” Horilla’s default configuration is with this type. If you want to use any other, you have to mention the API endpoints in the Outlook API configuration in Horilla.
Account Type | Authorization URL | Token URL | API Endpoint |
Accounts in any organizational directory (Azure AD multi-tenant) | https://login.microsoftonline.com/common/oauth2/v2.0/authorize | https://login.microsoftonline.com/common/oauth2/v2.0/token | https://graph.microsoft.com/v1.0/ |
Accounts in any organizational directory and personal Microsoft accounts (Multi-tenant + MSA) | https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize | https://login.microsoftonline.com/consumers/oauth2/v2.0/token | https://graph.microsoft.com/v1.0/ |
Accounts in a specific organization’s directory (Single-tenant) | https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize | https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token | https://graph.microsoft.com/v1.0/ |
Personal Microsoft accounts only (MSA only) | https://login.live.com/oauth20_authorize.srf | https://login.live.com/oauth20_token.srf | https://graph.microsoft.com/v1.0/ |
Set the Platform to: Web
Set the redirect URI to:
https://your.hrms.domain/outlook/callback
Step 4: Create a Client Secret

In the registered application, navigate to Certificates & secrets.
Click New client secret.
Provide a description and expiration period. Click Add and copy the secret value (store it securely as it won’t be visible again).

Take note of the details below.
- Client ID
- Secret Value
- Client Secret
- Tenant ID
All the other details mentioned above will find in the overview section (not the client’s secret value)

Step 5: Update Horilla Settings
SSH into your Horilla server and navigate to its directory:
cd /path/to/horilla
Open the settings file:
sudo nano horilla/settings.py
Add outlook_auth to INSTALLED_APPS:
INSTALLED_APPS = [
...
"outlook_auth",
]
Set the email backend:
EMAIL_BACKEND = "outlook_auth.backends.OutlookBackend"
Save the file and exit.
Step 6: Install Dependencies and Migrate Database
Run the following commands to install the required packages and migrate the database:
pip install -r requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate
Step 7: Restart the Horilla Server
After applying the changes, restart the Horilla server or service.
sudo systemctl restart horilla #restart your service
Step 8: Configure Outlook in Horilla HRMS
Navigate to:
https://your.hrms.domain/outlook/view-outlook-servers
Click Create New.

Fill in the details from your Azure App registration (Client ID, Secret, etc.).
Set the redirect URI to:
https://your.hrms.domain/outlook/callback
Save the form.
Step 9: Send a Test Email
After authentication, test sending an email through Horilla HRMS to confirm successful integration.
Conclusion
Integrating Outlook authentication with Horilla HRMS enhances the security and efficiency of email communications within your HR operations. By leveraging Azure’s authentication mechanism, organizations can ensure that only authorized users access email functionalities, preventing unauthorized access and potential security threats.
With this integration, HR teams can automate notifications, streamline recruitment processes, and improve overall communication. If you encounter any issues, refer to the Azure documentation or Horilla support for troubleshooting. Embrace this seamless integration to optimize your HRMS workflow and enhance productivity.