2

I'm having problems authenticating Azure Devops API using console applications

After call Get Projects API on AzureDevOps i get a redirect... to login page

curl -u :${B64_PAT} "https://dev.azure.com/xxxxxxxxxxxx/_apis/projects?api-version=6.0"

Return:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://spsprodsbr1.vssps.visualstudio.com/_signin?rea

I need call this API from a "Java Server Application", but I'm having a problem with this return to the login page. But I would like to follow Device Authentication flow

1 Answer 1

7

I can reproduce your issue on my side, to solve the issue, please pass your PAT directly to the command without base64 encode.

curl -u :<PAT> "https://dev.azure.com/xxxxxxxxxxxx/_apis/projects?api-version=6.0"

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

I can't believe it was just that. I ended up implementing oauth, I'm going to use PAT because it's really simpler... Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.