Gal I.
Gal I.

Reputation: 251

getting 203 with error when using vsts rest api

When I'm trying to create a new work item in VSTS with the POST request:

https://galilinetsky.visualstudio.com/Automatiom/_apis/wit/workitems/$Test%20Case?api-version=5.0-preview.2

I get the next response :

Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled on your environment. This enhanced level of security prevents our web integration experiences from displaying or performing correctly. To continue with your operation please disable this configuration or contact your administrator.

What am I doing wrong?

Upvotes: 9

Views: 10167

Answers (3)

J.Doe
J.Doe

Reputation: 189

adding on to @numeratus This question took awhile for me to get correctly on powershell. https://www.opentechguides.com/how-to/article/azure/201/devops-rest-powershell.html helped me greatly and a resulting simplified powershell request to azure apis

#enter your token in pat token
$pat = "xxx"

# Create header with PAT
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($pat)"))
$header = @{authorization = "Basic $token"}

#enter your url in projects url
$projectsUrl = "https://feeds.dev.azure.com/"
$projects = Invoke-RestMethod -Uri $projectsUrl -Method Get -ContentType "application/json" -Headers $header

Upvotes: 1

numeratus
numeratus

Reputation: 638

The solution is to be found in a similar question: Why I get Internet Explorer enhanced security error message in Chrome if I call VSO API from Angularjs SPA?

Andy writes

the PAT has to be prefix[ed] by ":" before you base 64 encode it"

So the solution is:

  1. Create a Personal Access Token
  2. Add a colon (':') before it
  3. Encode the new PAT (with the preceding colon) using Base 64

Et voila ! That PAT will no longer give you a 203 error.

Upvotes: 23

Marina Liu
Marina Liu

Reputation: 38106

It's mainly caused by the PAT format is incorrect.

Such as if I add colon : before the PAT, the REST API will return with 203.

enter image description here

Upvotes: 9

Related Questions