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

Amith Kumar Mutakari
2023-01-22 11:10

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 requireseparate authenticationmethods to achieve this access.

Tologinto 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 UsersandAllow Created Users Access to Profile Pagecheckboxes first.)
  2. After the first login, the SAML user'sUserIDwill be saved in Artifactory. Thereafter, the SAML user may generate an API key through theUIor via the use of theCreate API KeyREST API.

This now works with an "Identity Token" as well, which can be generated through the UI in the "Edit Profile" section under the Welcome User tab.

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