Hello,
I am having Problems connecting to Jira Server (8.20.2) with the PAT key. Over Powershell or Curl.
It is worth noting that the connection works when I use the Username/Password combination
These are the commands I am using:
Powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$User = '<email address>'
$pass = '<PAT>'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
Invoke-WebRequest -Uri 'https://<server url>/rest/api/latest/issue/<Issue Number>' -Method GET -Headers $Headers
Curl
curl.exe --request GET --url 'https://<server url>/rest/api/latest/issue/<Issue Number>' --user '<email address>:<PAT>' --header 'Accept: application/json' --header 'Content-Type: application/json'
Everytime I try I am getting the following error:
Powershell Output
Invoke-WebRequest:
Line |
11 | Invoke-WebRequest -Uri 'https://<server url>/rest/api/latest/issue/T …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Unauthorized (401)
(function() {
var contextPath = '';
function printDeprecatedMsg() {
if (console && console.warn) {
console.warn('DEPRECATED JS - contextPath global variable has been deprecated since 7.4.0. Use `wrm/context-path` module instead.');
}
}
Object.defineProperty(window, 'contextPath', {
get: function() {
printDeprecatedMsg();
return contextPath;
},
set: function(value) {
printDeprecatedMsg();
contextPath = value;
}
});
})();
Curl Output:
<html>
<head>
<title>Unauthorized (401)</title>
<!--[if IE]><![endif]-->
<script type="text/javascript">
(function() {
var contextPath = '';
function printDeprecatedMsg() {
if (console && console.warn) {
console.warn('DEPRECATED JS - contextPath global variable has been deprecated since 7.4.0. Use `wrm/context-path` module instead.');
}
}
Object.defineProperty(window, 'contextPath', {
get: function() {
printDeprecatedMsg();
return contextPath;
},
set: function(value) {
printDeprecatedMsg();
contextPath = value;
}
});
})();