Azure bot OAuth2 connection (Generic Oauth 2) setup does not work

Copper Contributor

Hi Microsoft folks! We have been trying to get our OAuth2 connection to our REST API to work via Azure Bot but we have been hitting a roadblock. Here is the problem.

 

The OAuth2 redirect URI (https://token.botframework.com/.auth/web/redirect) keeps returning the following response:

 

 

 

{
"message": "Login failed",
"statusCode": 503,
"responseBody": "503 Service Unavailable. No server is available to handle this request."
}

 

 

 

Here are the following steps that we have taken in an attempt to get the OAuth2 integration to work:

  1. Create an Azure bot
  2. In configuration > Add OAuth Connection Settings
  3. Select service provider Generic Oauth 2 and provided all the required fields and save.

When we hit on Test Connection, Azure correctly directs us to our app's authorization grant page. However, once the user grants access, the callback to token.botframework.com with the authorization code provided in the code query param times out and fails with the above message.


I have personally tested out the flow manually via Postman and could retrieve access tokens from our API so it's not something wrong on our end.


The server response is not descriptive enough and as a result, we do not know how to proceed. We have seen a few posts online facing sort of (not exactly) the same issue but without any meaningful resolution.

  1. https://techcommunity.microsoft.com/t5/teams-developer/msteams-bot-oauthprompt-generic-oauth-2-token...
  2. https://stackoverflow.com/questions/75530331/azure-bot-oauth-2-generic-provider-login-failed-status-...

Could you please provide advice and / or someone to guide us through resolving this issue?


Thanks!

4 Replies
@bot_manager - Thanks for reporting your issue.
We will check this at our end and will get back to you.
@bot_manager -We are not able to repro the scenario, we have tried with the above repro steps. but it is working fine from our end.

A 503 Service Unavailable Error indicates that a web server is temporarily unable to handle a request. That could be the web server you’re trying to access directly, or another server that web server is in turn trying to access. It’s called a 503 error because that’s the HTTP status code that the web server uses to define that kind of error. The error can occur for a number of reasons, but the two most common reasons are that the server is overwhelmed with requests or is having maintenance performed on it.

Meanwhile we are checking with the internal team and get back to you once we get any update.
We figured out the issue. Our VPN network was not allowing the request through. We have been able to circumvent it. If I may suggest, it would be nice if the error message indicated whether the request was unable to reach a microsoft service or whatever service it was trying to contact. It was really hard to discern whether it was an issue on our end or not
@bot_manager - Glad to hear that your issue is resolved. We will keep in mind and update it accordingly.