ARTIFACTORY: How to Authenticate Command-Line Tools When Using the SAML SSO to Access Artifactory

Amith Kumar Mutakari
2021-03-30 11:16

If you use SAML with Artifactory, by design the SAML 2.0 standard allows SAML users access to the Artifactory UI via SAML SSO. However, command-line tools require separate authentication methods to achieve this access.

To login to Artifactory via clients such as Docker, npm, and Maven, you can generate an API key for SAML SSO users by doing the following:

  1. Login to the Artifactory UI using SAML (Note: Be sure to tick the SAML configuration->Auto Create Artifactory Users and Allow Created Users Access to Profile Page checkboxes first.)
  2. After the first login, the SAML user's UserID will be saved in Artifactory. Thereafter, the SAML user may generate an API key through the UI or via the use of the Create API Key REST API.

Once an API key has been generated, it can be used instead of a password or instead of both a UserID and a password. Be aware, however, that this will require a dedicated REST API header.