Is there a way to authenticate to Confluence using a Personal Access Token with PowerShell? I don't see a method using the ConfluencePS module. My connection script uses that PowerShell module via the Set-ConfluenceInfo method, but there does not seem to be a way to use the PAT with it.
Hi @Dennis A_
Welcome to the Atlassian Community.
ConfluencePS is maintained by a community unrelated to Atlassian. More information can be found in https://atlassianps.org/docs/Contributing/ .
Checking their documentation I don't see something specific to authenticate with PAT on Confluence Server/DC.
However, on the server configuration there seems to be a possibility to include http headers on every request, on which you might be able to configure your user's PAT.
See https://atlassianps.org/docs/AtlassianPS.Configuration/commands/Add-ServerConfiguration/ for more information on that configuration.
I hope that helps.
Kind regards
Thiago Masutti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not sure if this will help, but i connected using a token like this.
Import-Module ConfluencePS
$Username = '************@gmail.com'
#generate a key from here https://id.atlassian.com/manage-profile/security/api-tokens
$Key = '******************************************' `
| ConvertTo-SecureString -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PsCredential($Username,$Key)
#Set-ConfluenceInfo -BaseURI 'https://********.atlassian.net/wiki' -Credential $Credentials
Get-ConfluenceSpace
#https://***********.atlassian.net/wiki/spaces/~712020e628e2b3818645efb1b64e5371f102bc/pages/294914/page+1
Get-ConfluencePage -PageID 294914 | Format-List * #get page info including content
#get space ley from it's url
$pages = Get-ConfluencePage -SpaceKey "~712020e628e2b3818645efb1b64e5371f102bc"
$pages | ForEach-Object { $_.Body } #gets page content as HTML
Gist https://gist.github.com/tristian2/c33692cbe46e287dd4f9bd5bb887ddb5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.