Using MSAL to authenticate to ADO Rest API returns not found

Viewed 121

I am trying to use MSAL to authenticate to ADO in my automation. I have started with the samples at https://github.com/microsoft/azure-devops-auth-samples/tree/master/ManagedClientConsoleAppSample. I have created an Application in my AAD tenant, and when I run SignInUserAndGetTokenUsingMSAL it brings up a browser window and prompts for the user. Once that is complete, I can paste the returned token into a token decoder, and it has a valid token that has the values I expect. But when the sample calls _apis/projects?stateFilter=All&api-version=2.2 it is returning a 404 Not Found. There are multiple projects in my ADO organization, and I expected there to be results. In order to test if the returned token is good, I added a call to https://{AccountName}.vssps.visualstudio.com/" from https://github.com/microsoft/azure-devops-auth-samples/blob/master/ManagedClientConsoleAppSample/Program.cs to the original sample. It returns a json object that matches my user. I think that there is some permission issue with my user, but I don't know what permission I am missing. Can anyone point me to what permissions I should verify, or what other debugging I can do to find the problem?

0 Answers
Related