By default the Conan CLI access token has been set to one-month expiry by design and we will not be able to refresh. In order to overcome this behavior, we can update the Artifactory configuration using the below steps.
- Navigate to $JFROG_HOME/artifactory/var/etc/artifactory/ and add the below properties in the artifactory.system.properties file.
artifactory.artifactory.tokens.expiration.timeSecs = 31536000
Note:- Here we are mentioning the value in seconds and the above value is for 1 year. - Save the file and restart the Artifactory server. If your server on HA, we will need to perform a rolling restart of nodes . Perform a login to the newly created conan repository.
> conan user -p <password> -r vj-conan1 admin Changed user of remote 'vj-conan1' from 'None' (anonymous) to 'admin'
In the below screenshot, the token is being generated for 1 year after performing a login.
Disclaimer: It is not recommended to increase the token expiry time as it might lead to an uncertain security issue rather you can create new tokens.