AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

Getting "For security reasons Jira requires you to log on to the website before continuing", even with PAT (personal access token) #485

Open mbourgon opened 10 months ago

mbourgon commented 10 months ago

Description

Starting the past couple of weeks, i've started getting this error trying to use JiraPS: Invoke-JiraMethod : For security reasons Jira requires you to log on to the website before continuing.

Trying to move to using a personal access token doesn't seem to work either.

Steps To Reproduce

  1. Set-JiraConfigServer -Server 'https://jira.mycompany.com"
  2. $username = "mycompanyusername"
  3. $password = "mypersonalaccesstoken"
  4. $secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
  5. $mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpasswd)
  6. New-JiraSession -Credential $mycreds
  7. Get-JiraIssue -Issue "RXNS2-15297"

also not working: $cred3 = Get-Credential -UserName $username -Message "mypersonalaccesstokenhere"

at this point it asks for my password - I enter it

New-JiraSession -Credential $cred3

In fact, I get this error on that one: Invoke-JiraMethod : The user could not be authenticated.

Expected behavior

To log in.

Screenshots

Your Environment

Possible Solution

My only idea is something to do with our local jira instance, but even the documentation barely covers using PATs.

mbourgon commented 10 months ago

If I use curl -v https://jira.mycompanyname.com --user myname@mycompanyname.com:mypersonalaccesstoken the page returned says "AUTHENTICATED FAILED"

if I use curl -v https://jira.mycompanyname.com --user myname:mypersonalaccesstoken the page returned says "AUTHENTICATION_DENIED"