7

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?

Community
  • 1
  • 1
Gal I.
  • 201
  • 3
  • 12

3 Answers3

22

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.

numeratus
  • 628
  • 1
  • 6
  • 12
9

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

Marina Liu
  • 36,876
  • 5
  • 61
  • 74
  • 2
    I get the same problem with my GET/POST requests, but there is no colon before the Personal Access Token, and adding one to the PAT results in a 401 error (instead of a 203 error). – numeratus Mar 08 '19 at 12:13
1

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
J.Doe
  • 155
  • 1
  • 9