How to fix VSTS API 400 bad request DelegatedAuthorizationException

How to fix VSTS API 400 bad request DelegatedAuthorizationException Real quick, I was integrated with the VSTS (Visual Studio Team Services) API by calling https://app.vssps.visualstudio.com/oauth2/authorize… and I was getting the following:

400 Bad Request:
Exception of type ‘Microsoft.VisualStudio.Services.Web.Profile.Controllers.DelegatedAuthorizationException’ was thrown.

Not a super helpful error message, but the fix was simple.

  1. Make sure all your parameter names are spelled correctly, and that the redirect_uri parameter matches exactly what you defined when you registered your app here: https://app.vssps.visualstudio.com/app/register
  2. The redirect URI that you registered and the paramater your passing in both have to be HTTPS.
Like what you read? Give Erik Elkins a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.