Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Switching from Basic Authentication to API Token

Aaron Jones July 18, 2019

A previous employee setup scripts to create tickets on a schedule, he had set it up to use basic authentication but with that being depreciated and most of the scripting experience left the company with him, I am asking how to switch out the basic authentication piece of the scripts with the API token.

 

I've created an API token for the account used to create the tickets but I've been having trouble finding anything definitive on using the API token instead of the basic authentication with the small bit of scripting experience I have.

 

Any help would be appreciated. Examples of current setup below:

 


#Connect to Jira API
#===================
if ($Jira){

Write-Host "Logging into Jira API" -ForegroundColor Cyan
$Global:signinName = cat c:\scripts\JIRAadminuser.txt
$Global:pass = cat c:\scripts\JIRASec.pwd | convertto-securestring
$Global:cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $signinName, $pass
New-JiraSession -Credential $Global:cred

1 answer

1 vote
Thomas Deiler
Community Champion
July 18, 2019

Dear @Aaron Jones ,

it is pretty simple. Following this document, you just have to replace the password value with the token value. But be sure to use the email as user name.

So long

Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events