Authentication using npm login
was introduced in version 5.4.
Run the following command in your npm client. When prompted, provide your Artifactory login credentials:
npm login
Upon running this command, Artifactory creates an expirable access token which the client uses for authentication against Artifactory for subsequent and npm install npm publish
actions.
Note
The npm access token expires within 30 days. To modify the token expiry period, use this Artifactory system property: artifactory.artifactory.tokens.expiration.timeSecs
, which affects all tokens in Artifactory.
If the token is removed from Artifactory, the client will have to log in again to receive a new token. If the token has expired, run npm login
again.
npm-login Limitation
If an Admin creates an access token with a transient user, npm login
will fail as the user is not registered in Artifactory.