Microsoft Oauth2: Can't add local redirect URL with query params to Azure App registrations

Hello,

I am working on a freshdesk-app to integrate Business Central with Freshdesk. I am unable to get the Oauth2 access token from Microsoft in local because i can’t add the local redirect URL with the query params to App registrations in Azure.

Is it not possible to locally test apps that integrate with Mirosoft’s Oauth2-Authorization?

Hi @re2918,

Welcome to our Freshworks developer community! :tada:

If the third-party system doesn’t allow a localhost URL, you could run FDK with the command, fdk run --tunnel. It will generate an HTTPS domain that can be accessed over the internet. It will look like the following.

Establishing ngrok tunnel. Please wait...

Tunnel Open. Tunnel URL: https://e1cd-xxxxxxxxxxxxxxxxxxxxxxxxxxx-3f5b.ngrok.io

Starting local testing server at http://*:10001/
Append 'dev=true' to your Freshdesk account URL to start testing
e.g. https://domain.freshdesk.com/a/tickets/1?dev=true
Quit the server with Control-C.

To simulate product, app setup, and external events, visit - http://localhost:10001/web/test
Populating test data with events found in the app
To test the installation page, visit - http://localhost:10001/custom_configs

The tunnel domain (without any port) can be used in place of the localhost domain and port for local testing of OAuth 2.0.

1 Like

Hi @Raviraj,

Thank you, i’m excited to be here.

Thank you for your answer. Microsoft’s Oauth system does allow localhost URLs. I did however find out what my problem was: I assumed that the whitespace after “?callback=” was there by mistake and deleted it. Here’s how i made it work:

First i clicked on authorize of my app:
image

I then copied the redirect url shown in the microsoft error:

I encoded the part after ?callback= (including the whitespace in the beginning encoded to %20):

Lastly i added the encoded part back to the full url and entered it into Azure App registrations:

I hope this helps someone else who has a similar problem

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.