Better Hub Access Guide
Introduction
This guide provides step-by-step instructions for logging into Artifactory using SAML authentication and generating an Access Token to access artifacts in the Registry that you have permission to access.
Logging into Artifactory via SAML
Navigate to Artifactory
Using a web browser navigate to your Artifactory URL: https://hub.better.care/
Signing In
Locate and click the »SAML SSO« button below the Login button.
You will be redirected to Better’s Identity Provider (Entra ID) and prompted for login information. To login, use your domain account (ending with @better.care).
Once logged in, you will be prompted for Multi-Factor Authentication via the Authenticator app.
If you’re not prompted for the Multi-Factor Step, you might have to set it up first. Please review the instructions or contact your administrator.
Creating Access Token
Explanation of Access Tokens
Because users authenticated through an external source are not kept locally in Artifactory it’s not possible to use your username and password to log in to artifactory via CLI tools such as docker, mvn, npm. …
For this purpose Access Tokens are used, replacing the user’s password. These tokens work similarly to how Personal Access Tokens (PAT) work in many other enterprise solutions such as GitHub, GitLab, Harbor, etc..
Therefore, you can authenticate with a combination of username and access token.
Accessing user profile
Access tokens are tied to the user profile. To create an access token, first navigate to you user profile.
-
Click on the circle in top right corner representing your user
-
Click on »Edit Profle«
Configuring Access Token
To create the access token:
-
Click on »Generate an Identity Token« on the top
-
Enter the token description – for exampel what you’ll use the token for.
-
Click »Next« to generate the token
Using Access Token
Maven Repository Access
Modify your settings.xml to include the additional repositories hosted on Artifactory.
<servers>
<server>
<id>ARTIIFACTORY_MVN_REPO</id>
<username>YOUR_USERNAME</username>
<password>YOUR_ACCESS_TOKEN</password>
</server>
</servers>
NPM Repository Access
To log in to the NPM repository, you must first encode your token using
Base64. This can be done directly through the Better hub by making an
HTTPS request from your terminal using the curl command or a command-line
tool of your choice.
curl -u USERNAME:ACCESS_TOKEN https://hub.better.care/artifactory/api/npm/auth
Expected Output:
_auth = <ENCODED_TOKEN>
always-auth = true
Once you obtain the encoded token, you need to set it in your npm configuration (.npmrc).
To do so, execute the following commands:
npm config set '//hub.better.care/:_auth' <ENCODED_TOKEN>
npm config set '@better:registry' https://hub.better.care/npm/
Note: Replace <ENCODED_TOKEN> with the Base64-encoded token you obtained.