Forum Discussion

PedroKlein's avatar
PedroKlein
Copper Contributor
Nov 13, 2023

Bot Framework Token Service - Error building redirect URI with query params

Hi,

 

I am currently using the Token Service with my bot for OAuth authentication with no problems so far, but there was a recent need to add a query parameter into my Authorization URL in the bot OAuth Connection Settings that seems to be breaking my application.
Checking some logs on my authentication service end I notice that the final redirect URI is being wrongly build. 

 

This is my url in the Authorization URL field at the OAuth Connection Settings, with a fictional domain:

https://www.authservicehere.com/oauth2/v0/authorize?siwc=true

 

This is the redirect being generate by the Token Service:

https://https://www.authservicehere.com/oauth2/v0/authorize?siwc=true/oauth2/v0/authorize?redirect_uri=https://token.botframework.com/.auth/web/redirect&siwc=true?client_id=xxxxxx

 

Notice that it should be a & after the siwc param, the correct redirect URI would be:

https://https://www.authservicehere.com/oauth2/v0/authorize?siwc=true/oauth2/v0/authorize?redirect_uri=https://token.botframework.com/.auth/web/redirect&siwc=true&client_id=xxxxxx

 

It could also be without the siwc param, since its only used in the authorization url like so:

https://https://www.authservicehere.com/oauth2/v0/authorize?siwc=true/oauth2/v0/authorize?redirect_uri=https://token.botframework.com/.auth/web/redirect&client_id=xxxxxx

 

Is this an expected behavior? How can I deal with params in my authorization URL?

 

Thanks.

8 Replies

    • PedroKlein's avatar
      PedroKlein
      Copper Contributor

      ChetanSharma-msft Sure, I am using a very similar login process as this https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/app-complete-auth/nodejs/bots/teamsBot.js using the Bot Framework https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-concept-authentication?view=azure-bot-service-4.0#about-the-bot-framework-token-service to manage my OAuth flow, my bot oauth config looks like this:

      Without the query param siwc=true, the token service is working as expected.

Resources