If you're seeing the following error while authenticating a Microsoft account:
The client secret for your Azure application has expired.
Please renew the client secret in the Azure Directory and try againIt indicates that your Microsoft Azure Client Secret associated with your Nylas application has expired. The client secret is a key piece of information for your Azure Application to connect with Nylas. It's crucial to ensure that it is up-to-date for the seamless operation of any Office 365 accounts.
Best Practices: When the old client secret expires, all accounts go invalid and require all users to re-authenticate their accounts. You can have two client secrets active within Azure at any time. As such we advise creating an additional client secret every 12 months before the old secret expires to give your users time to re-authenticate. Since the client secret is only used on the initial authentication, changing it from the Nylas Dashboard will not affect existing connected accounts and all new accounts will be authenticated using the new client secret.
Resolution Steps
To resolve this issue, follow the steps outlined below, which are also available in the official Microsoft Documentation
- Log in to the Azure portal.
- Search for "Microsoft Entra ID" in the search box at the top.
- Navigate to "App registrations" and select your application.
- In the left-hand menu, click on "Certificates & secrets."
- Click on "New client secret."
- Add a description for the secret, choose an expiry duration, and click "Add."
- Make a note of the value of the client secret - this is your new client secret.
Updating the Client Secret in Nylas
After renewing the client secret on the Azure side, please also update this new secret in the Nylas Dashboard and in your code where required:
- Log in to dashboard-v3.nylas.com
- Navigate to your application → Connectors
- Select the Microsoft connector for edition
- Update the Azure client secret with the newly generated value
- Save changes
If you encounter any difficulties or require further assistance, don't hesitate to contact our support team.
Confirm accounts can re-authenticate
1. Connect an Office365 account and confirm they can reconnect - Note: it can take up to an hour
2. You can view successful logins via the Auth logs in the dashboard.nylas.com
Note: Azure Active Directory is now Microsoft Entra ID. More information can be found here
Resources
- https://developer.nylas.com/docs/developer-guide/provider-guides/microsoft/create-azure-app/#add-client-id-and-client-secret-to-nylas
- https://learn.microsoft.com/en-us/troubleshoot/azure/general/invalid-client-secret#resolution
Updated
Comments
0 comments
Article is closed for comments.