0
votes

I am trying to get the sample v1 AuthBot example working. I added the /api/OAuthCallback reply url in Azure:

enter image description here

...but, when I use this as the RedirectUrl in my Web.Config I see this error:

enter image description here

Everything works fine with this URI:

https://REDACTED.azurewebsites.net/.auth/login/aad/callback

BUT this isn't compatible with AuthBot? Does anyone know how to fix this so that the authentication works and I can recieve a token? Thanks for the help!

EDIT #1:

I deployed the API to azure using visual studio. There was an Active Directory already set up and I went to the bot's authentication settings in Azure in order to use my current AD to login users. When I use these settings in my Web.Config App Settings (AAD Auth V1 Setting Values)...

<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.windows.net/" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="XXXXXX.com" />
<add key="ActiveDirectory.ClientId" value="XXXXX" />
<add key="ActiveDirectory.ClientSecret" value="XXXXX" />
<add key="ActiveDirectory.RedirectUrl" value="https://REDACTED.azurewebsites.net/.auth/login/aad/callback" />

I can click the Link here:

enter image description here

and I can login successfully... but AuthBot is expecting a link formated like: https://REDACTED.azurewebsites.net/api/OAuthCallback in order to retrieve a token? My problem is the AuthBot Controller class is looking for a Route like [Route("api/OAuthCallback")] NOT [Route(".auth/login/aad/callback")]

1
Can you give some details on how you deployed the API?Philippe Signoret
@PhilippeSignoret Added some more info in an Edit. Do you know how I should change my code to accomodate for this difference in api routes?Megan

1 Answers

1
votes

It wasn't working because I was testing the code in the Bot emulator and hadn't pushed my code to Azure yet! Once I did that and tested it in MS Teams it worked fine!