Forums

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

Confluence command line interface tokens not working

Ken Poulton December 17, 2012

I can't get login tokens to work.

>> confluence --action login --user poulton --password mypass

successfully returns a token Er9NXZafyy . But then I can't do actions with that token:

>> confluence --action getSpaceList --login Er9NXZafyy
Error: Parameter 'password' is required.

>> confluence --action getSpaceList --loginFromStandardInput < junk.l
Error: Parameter 'password' is required.

I'm using Confluence 3.5.6

1 answer

1 accepted

0 votes
Answer accepted
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2012

Use --password "". It will be ignored if the action you are using does not require a password and a token is provided. The token only works for SOAP based actions and a password is still required for non-SOAP actions. For Confluence, almost all actions are SOAP based still.

Ken Poulton December 17, 2012

Okay, this works:

>> confluence --action getSpaceList --user poulton --password "" --login Er9NXZafyy

It seems like a bug to me that when --login is used it still requires a null --password. Even an error message that says this is required would address this.

There is a different bug in --loginFromStandardInput:

>> confluence --action login --user poulton --password mypass >junk.l
>> confluence --action getserverInfo --user poulton --password "" --loginFromStandardInput <junk.l

Remote error: com.atlassian.confluence.rpc.InvalidSessionException: User not authenticated or session expired. Call login() to open a new session

The problem turns out that it is expecting the DOS CR-LF in the file! When I run this command on Linux, text file lines have only LF on each line as God and Dennis Ritchie intended.

A workaround for Linux users:

>>confluence --action login --user poulton --password wikiwiki | sed 's/$/^M/' >junk.l

where "^M" is ctrl-M (a.k.a. CR).

It seems like the Linux version of the confluence(1) CLI binary ought not to be expecting CR-LF.

Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2012

Yes, its a bit of an oddity that I have choosen not to fix. Password was always required (for all clients) before token support was added and in 99.9% of cases it is a convenient way to prevent people from forgetting to use it. Token support is limited to the SOAP request and is for more advanced users, etc... Over time non-SOAP requests will dominate (JIRA especially and eventually Confluence), so just leaving it as is.

Regarding your other issue, I opened CSOAP-178

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events