Token Service Gives a 500 Service Error When Exchanging Token #6764
Labels
Area: Teams
The issue is related to Teams support
bug
Indicates an unexpected problem or an unintended behavior.
needs-triage
The issue has just been created and it has not been reviewed by the team.
Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.
Version
4.22.2 DotNet C#
Describe the bug
I'm trying to set up SSO for my bot and a website.
The website is an Azure Web App that already has its own AAD Auth Set up.
The bot is hosted on Azure and also uses AAD. Auth is already working with the OAuthCard and Sign In button.
The idea is to keep users from having to authenticate 2 times, one for the website and another for the embedded bot. From what I've read with SSO I can pass the auth token that I received from the website to the bot and the bot will exchange this token for one of its own. Everything on behalf of the user.
This is what I've done so far:
Bot's App Registration
Bot Service
Web App
Using the C# debugger, I can see that my bot does receive the request, however the exchange fails with a 500 error. Specifically, the error occurs at the
ExchangeTokenAsync(turnContext, settings.ConnectionName, turnContext.Activity.From.Id, tokenExchangeRequest, cancellationToken)
call.Looking deeper I can see that the actual error occurs on the following REST API call:
REQUEST
Which returns the following error:
RESPONSE
What can be going on?
To Reproduce
Reproducing the exact thing might be tricky as it's tied to my own configuration. But following the explanation above with two other app registrations might work.
Expected behavior
I expect the TokenExchangeRequest to work, meaning the bot's OAuthCard is skipped as the user will be already authenticated.
The text was updated successfully, but these errors were encountered: