0
votes

I was able to create authenticate users against AD v2 (Graph) but Azure DevOps isn't part of Graph API so I need to authenticate the users against Azure DevOps directly.

On the DevOps new app registration:
When I tried to set the Authorization callback URL to https://token.botframework.com/.auth/web/redirect I get an error saying the url is already used (bug?), I've set it to https://token.botframework.com/.auth/web///redirect and it was accepted.

Now I have:

  • App ID
  • App secret
  • Client Secret
  • Authorize URL
  • Access Token URL
  • Authorized Scopes

On the Azure Bot connection setting I choose Generic Oauth 2 and set the following: (used this page)

  • Client Id: < DevOps app's app id >
  • Client secret: < DevOps app's client secret >
  • Authorization < URL: DevOps app's Authorize URL >
  • Token URL: < DevOps app's Access Token URL >
  • Refresh URL: < DevOps app's Authorize URL > (wrong?)
  • Scopes: < DevOps app's Authorized Scopes >

Now as I hit the 'Test Connection' I get 400 BAD REQUEST with:

Exception of type 'Microsoft.VisualStudio.Services.Web.Profile.Controllers.DelegatedAuthorizationException' was thrown.

Any ideas?

Update: Looks like it's indeed the callback issue. Azure DevOps won't accept existing callback URL (I've opened a bug and it was closed by them). Bot Framework guys are still looking into this, if they'll generate per-bot URL (as they should) it will probably solve the issue

1
Can you add some perspective on what you are trying to accomplish? Is this to allow CI/CD to deploy the bot code to Azure? Or are you trying to do Azure Dev Ops operations from within the bot? - Dana V
@DanaV The later is correct. I'm trying to create a bot which can perform Azure DevOps operations. DevOps closed my issue claiming this is not a bug and I should open a new 'suggestion'. Bot Framework are still looking into this - SagiLow

1 Answers

0
votes

Try using Autorization URL as

https://login.microsoftonline.com

and in your azure bot services go to OAuth Connection Settings, fill all the details and test.