ARTIFACTORY: How to Use Artifactory System Properties to Handle Access Token Expirations

ARTIFACTORY: How to Use Artifactory System Properties to Handle Access Token Expirations

AuthorFullName__c
Muhammed Kashif
articleNumber
000004756
ft:sourceType
Salesforce
FirstPublishedDate
2020-02-03T07:53:24Z
lastModifiedDate
2022-12-19
VersionNumber
9

Note: This Article is deprecated for 7.x latest versions and Access YAML configuration should be used
 

As access tokens contain the security credentials for a login session and identify users, user groups, the user privileges, they allow flexibility in the execution of authentications. Following are the system properties that can be used for handling access token expirations:

#Default = 3600 seconds (1 hour)

artifactory.access.token.non.admin.max.expires.in=<seconds>

#Default = 3600 seconds (1 hour)

artifactory.access.token.expiresIn.default=<seconds>

#Docker Tokens - Default: 9000
artifactory.docker.tokens.expiration.timeSecs=<seconds>

 

When artifactory.access.token.non.admin.max.expires.in=<seconds> is configured in your artifactory.system.properties file:

This property will not allow any non-admin users to create an access token greater than the value you set in the parameter. However, a user with admin privileges can override this value and set any expiry value for an access token.

When artifactory.access.token.expiresIn.default=<seconds> is configured in your artifactory.system.properties file:

This property will set the default expiry value for any access token created either by a non-admin user or by the admin user. When externally the “expires_in=<seconds>” option is passed while creating the access token, this will override the default value set.

Note: If <userTokenMaxExpiresInMinutes>60</userTokenMaxExpiresInMinutes> is available in $ARTIFACTORY_HOME/etc/artifactory.config.latest.xml, the system properties above will not take effect. 

To work with the above system properties, delete the <userTokenMaxExpiresInMinutes>60</userTokenMaxExpiresInMinutes> from the $ARTIFACTORY_HOME/etc/artifactory.config.latest.xml and change the file name to artifactory.config.latest.xml as : $ARTIFACTORY_HOME/etc/artifactory.config.import.xml

Restart Artifactory for this change to take effect.