ConfluencePS icon indicating copy to clipboard operation
ConfluencePS copied to clipboard

Need instructions for authenticating to Confluence Cloud

Open bkolodny opened this issue 2 years ago • 2 comments

Authenticating to confluence cloud is different than to an on prem server, and I and others do not know how to do it in ConfluencePS.

Instructions on how to do it should be added to the help.

bkolodny avatar May 18 '22 21:05 bkolodny

The documentation on authenticatiin is very poor (here). If your organization uses Single Sign-on, then you cannot use Get-Credential to obtain a credential for ConfluencePS or JiraPS. Furthermore, there is ZERO documentaion on how to use an API token for ConfluencePS or JiraPS. As far as I can see, it sadly does not appear possible.

If using an API token is possible, then somene please post an example (with ALL steps). For example, with Get-ConfluenceSpace.

awsles avatar Sep 08 '22 13:09 awsles

Get-Credential works with with SSO... You just don't use your password but a personal API token for the password field (obtainable via https://id.atlassian.com/manage-profile/security/api-tokens). Example:

$creds = get-credential
Set-ConfluenceInfo -Credential $creds -BaseURI "https://your-domain/atlasssian.net/wiki"

Also for those using Powershell 7 like me, where Get-Credentials is kinda gimped, I build the credential object in my scripts the old fashioned way.

$api_key = ConvertTo-SecureString <api_key> -AsPlainText -Force
$username = <username>
$creds = New-Object System.Management.Automation.PSCredential ($username, $api_key)

therealscottcarlow avatar Feb 27 '23 19:02 therealscottcarlow