Since Microsoft deprecating the Basic Auth flow. We will not be able to send/receive outlook emails in our email channel inbox with basic authentication, now we will need to implement the Oauth2.0 flow and get the access tokens from the Azure app. To implement this in your self-hosted version follow the below steps.
Register An Azure App
To add email channel inbox for outlook email, you have to create azure app in the Microsoft Azure portal. You can find more details about creating Azure App here.
- In the app registration page, click on
New Registrationand select the any account type.
Once you register your Azure App, make sure you add proper account type according to your use and add redirect URL for your domain
You can find more details about redirect URL here.
- Then click on
Certificates & Secretstab and add new secret key for your application.
- Then copy the client secret value immidiately after adding the key and store it somewhere, this is your
- Click on
API permissionsand add all the permission shown below to integrate email inbox. You can find more details about it here.
- Click on
Token Configurationand add optional claims shown in the image.
Configuring the Environment Variables in Chatwoot
Configure the following Chatwoot environment variables with the values you have obtained during the Azure app setup.
AZURE_APP_ID should be a unique application id or client id you get while configuring the Azure app.
AZURE_APP_SECRET is nothing but the
client_secret you got in the third step.
Restart the chatwoot server after updating the environment variables
Testing the Azure app with outlook email channel
Until the application is verified for production, You will see unverified during the authorization from the authorization prompt. To test the changes until the app is verified for production. You should use the azure app registration email address in chatwoot channel and you would be able to test the flow on your local or any other instance.
Going into production.
- Go to:
Branding & Propertiesand add your domain details, and then click
Verify and Save.
We are handling the mentioned steps about the hosting
Once you set
AZURE_APP_ID in your environment variable, consider this step is completed.
You're done! Next, you should enable the outlook email channel in chatwoot inbox.
email@example.com is an email for which you are adding a new inbox.
You need to get your publisher verified to be able to attach and fetch mails from the Azure app with any other outlook email.