Conan occasionally loses authentication with Artifactory remote
Describe the bug
I noticed on many occasions that Conan loses authentication with Artifactory remote.
It gets noticed when conan commands fail to find any packages in the remote.
Need to re-authenticate using conan remote login command. This isn't very pleasant for the user and any automation using conan commands.
I presume we only need to authenticate the remote once and then it should stay until local conan cache is deleted.
I am using Conan 2.3.1, but has noticed this issue with older versions of Conan2 too.
How to reproduce it
No response
Hi @sharadupadhyaya
Conan uses JWT tokens to communicate with the servers. These tokens, by its nature have a expiry date. I think this is set by default in servers like Artifactory to 1 month, see https://jfrog.com/help/r/artifactory-how-to-refresh-the-conan-cli-access-token/artifactory-how-to-refresh-the-conan-cli-access-token
This is a security mechanism. If you want to increase that time, you can do it via Artifactory configuration properties, but note that the longer the time, the less secure are the tokens.
Got it. Thanks @memsharded
Is the above consistent with your experience @sharadupadhyaya, and the tokens are being expired like monthly? If that is the case and this is confirmed, then I think we can close this ticket as resolved.
Any further feedback here @sharadupadhyaya? Are the tokens expired monthly?
Yes, the tokens are being expired monthly. I have started using Identity Tokens instead of API Key to authenticate with Artifactory, they expire yearly.
On Wed, 4 Sep 2024 at 10:36 PM, James @.***> wrote:
Any further feedback here @sharadupadhyaya https://github.com/sharadupadhyaya? Are the tokens expired monthly?
— Reply to this email directly, view it on GitHub https://github.com/conan-io/conan/issues/16368#issuecomment-2330187797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMGHP6O3CD7AGRJPTTA2XNTZU54MZAVCNFSM6AAAAABIPFVMPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZQGE4DONZZG4 . You are receiving this because you were mentioned.Message ID: @.***>
Thanks for the feedback. Just please take into account that long-lived tokens are somewhat less secure than short-lived tokens. For sure the shorter they live the more inconvenience it is, and devs and CI need to auth more often, but it is generally considered safer.
I think this question can be closed as solved, please don't hesitate to create new tickets as necessary.