I am developing a custom app to read a file from my OneDrive.
To authenticate with Microsoft and access the file, I need to configure a redirect URI. I have configured the following redirect URIs in the Azure App Registration:
However, the authentication is not working, and I’m encountering an “Invalid state” error during the callback.
Could you please confirm whether these are the correct redirect URIs to use for a Freshworks custom app? Or should I configure the following URL as the redirect URI instead?d3h0owdjgzys62.cloudfront.net
When configuring Microsoft Entra ID (Azure AD) OAuth for Freshworks apps (both local FDK testing and production deployment on oauth.freshdev.io), there are three common pitfalls that trigger authorization failures:
Platform Configuration in Entra ID (Web vs SPA):
In Azure App Registration under Authentication → Add a platform, ensure you add Web and NOT Single Page Application (SPA). The Freshworks OAuth service (oauth.freshdev.io) performs the token exchange via authorization code grant on the backend server, so selecting SPA will cause Microsoft to reject client secret authentication during the token handshake.
Redirect URI Formatting & Trailing Slashes:
Azure is strictly case-sensitive and character-exact regarding reply URLs. Ensure both entries are saved exactly as:
Local testing: http://localhost:10001/auth/callback
Production: https://oauth.freshdev.io/auth/callback
(Make sure there is no trailing slash / at the end of callback).
Mandatory offline_access in Scope (oauth_config.json):
For Microsoft Graph API, if offline_access is not explicitly included in the scopes, Microsoft will only return an access_token without a refresh_token. The Freshworks OAuth broker requires a refresh_token to persist the session and refresh expired tokens automatically; without it, the callback will fail with a generic token handling error.
If you are using a multi-tenant or personal account setup, ensure {tenant} is set to common or consumers, otherwise use your specific Entra Tenant Directory ID.
No, the CloudFront URL (d3h0owdjgzys62.cloudfront.net) is only the static asset CDN where Freshworks hosts your custom app front-end files, not the OAuth callback endpoint.
In your Microsoft Entra (Azure AD) app registration, the Redirect URI must be set to https://oauth.freshdev.io/auth/callback for production and http://localhost:10001/auth/callback for local FDK testing.