1
votes

I'm stuck on authorizing my C# MVC app to Azure DevOps Services API using Oauth 2.0. I followed this tutorial: https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops

When I request the following authorize URL I will get an error 'InvalidScope'. So, I must be doing something wrong.

https://app.vssps.visualstudio.com:443/oauth2/authorize?client_id={id}&response_type=Assertion&state=statestring&scope=vso.code_status&redirect_uri=https%3a%2f%2flocalhost%3a44380%2foauth%2fcallback

My callback URL has been successfully requested, but always with error 'InvalidScope' message. So, I don't understand what I'm doing wrong.

Much appreciated if somebody can help me further!

1
You must supply a scope in your request. In the article you shared there is a scopes part which you can look into. - vsarunov
Yes, I have seen the scope part of that article, so as you can see I have added 'scope=vso.code_status' to my request URL - Corné Strijkert

1 Answers

2
votes

The answer is that it's required to specify all available scopes in the authorize URL, so it seems all Azure DevOps scopes I have specified are required scopes.