Jump to content


Swarm API isn't accepting login with ticket


  • Please log in to reply
No replies to this topic

#1 Gurce

Gurce

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 27 November 2017 - 12:49 AM

I've been trying to access our workplace's swarm data via the swarm api, but have run into a problem of request being 'Unauthorized'.


I followed steps here:
- https://www.perforce.../swarm/api.html


When I tried it with the username:password method, I got the 'unauthorized' error:

curl -u "apiuser:password" https://myswarm.url/api/v5/projects
/api/v4/projects/gi-test Unexpected error: 401 : Unauthorized
[{"error":"Unauthorized"}:null]



When I tried it with the apiuser:ticket method (-p), I got the same 'unauthorized' error:

p4 -p myp4host:1666 -u apiuser login -p
curl -u "apiuser:ticket" https://myswarm.url/api/v5/projects
/api/v4/projects/gi-test Unexpected error: 401 : Unauthorized
[{"error":"Unauthorized"}:null]



However, when I tried it via the "host-unlocked ticket" (-ap) method, it worked!

p4 -p myp4host:1666 -u apiuser login -ap
curl -u "apiuser:ticket" https://myswarm.url/api/v5/projects

There was a mention in the docs that:

> For a Helix Versioning Engine that has been configured for security level 3, passwords are not accepted.

This looks like the reason why the "username:password" method failed for me. Our workplace confirmed that we are indeed on security level 3 with ldap logins.

All the same, why was only the host-unlocked ticket accepted and not the standard ticket?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users