You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will be looking to disable the basic Authentication against Jira in the next few months. However we are not able to create new sessions when using the PAT.
According to the documentation we are supposed to use the user's email address and the PAT to create a session. However, this does not appear to be working. https://atlassianps.org/docs/JiraPS/about/authentication.html#api-token
Expected to see the following (as we see with basic Auth):
Username WebSession
test Microsoft.PowerShell.Commands.WebRequestSession
Your Environment
Get-Module JiraPS -ListAvailable | Select Name, Version
Name Version
-----------
JiraPS 2.14.6$PSVersionTable
Name Value
---------
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The text was updated successfully, but these errors were encountered:
I was having a similar issue authenticating to a Jira Server instance. All the documentation is for Jira Cloud.
I was able to find an explanation of the difference when using a PAT here and I confirmed with curl.
So, I took a dive into New-JiraSession and then Invoke-JiraMethod.
Apparently you can use empty credentials $creds = [System.Management.Automation.PSCredential]::Empty
and manually create the authorization header. New-JiraSession -Headers @{Authorization="Bearer <PAT Token>"} -Credential $creds
Using JiraPS 2.14.6 trying to connect to Jira Server and on New-JiraSession -Headers @{Authorization="Bearer <PAT Token>"} -Credential $([System.Management.Automation.PSCredential]::Empty
I get an error: Invoke-JiraMethod : token contains an invalid number of segments
Description
We will be looking to disable the basic Authentication against Jira in the next few months. However we are not able to create new sessions when using the PAT.
According to the documentation we are supposed to use the user's email address and the PAT to create a session. However, this does not appear to be working.
https://atlassianps.org/docs/JiraPS/about/authentication.html#api-token
Steps To Reproduce
$password = ConvertTo-SecureString '<TOKEN>' -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential ('[email protected]', $password) New-JiraSession -Credential $creds
Expected behavior
Expected to see the following (as we see with basic Auth):
Username WebSession
test Microsoft.PowerShell.Commands.WebRequestSession
Your Environment
The text was updated successfully, but these errors were encountered: