ARTIFACTORY: How to Modify the Expiration Date of the Token Generated by the "npm login" Command

ARTIFACTORY: How to Modify the Expiration Date of the Token Generated by the "npm login" Command

Products
Frog_Artifactory
Content Type
Use_Case
AuthorFullName__c
Yunzong Guo
articleNumber
000006713
FirstPublishedDate
2025-12-15T08:54:34Z
lastModifiedDate
2025-12-15
VersionNumber
2
If you use the "npm login" command to authenticate with the Artifactory npm repository, after logging in, the generated token will be saved in the ~/.npmrc file by default, with a default validity period of 1 month (2592000s). After one month, you need to log in again via "npm login".

User-added image  

How to extend the validity period of this token to avoid frequent "npm login" attempts?
 
Solution 

You can modify the default expiration date of the token by the following steps:
  1. Edit the configuration file: $ARTIFACTORY_HOME/var/etc/artifactory/artifactory.system.properties, add the following parameter, and modify it to your expected time, such as 1 year(31536000s):
    artifactory.artifactory.tokens.expiration.timeSecs=31536000
  2. Restart Artifactory.
     
  3. Run "npm login" again. You can see on the UI that the token's validity period has been changed to 1 year.

    User-added image