Persist credentials independent of session cache
m-soltani opened this issue · 2 comments
I am on mac using pwsh core 7 and after when I try to register an azure artifact feed as a private powershell repository as described in the doc here: register private feed. This works perfectly for the first time I want to register the repository, but when I close the session and create a new session again, it asks me for a device authentication flow every time I want to run a command related to the registered repository.
Is there a way to cache the credentials independent of the session?
I would expect the credential provider's token cache to be working here.. suspect that PS is passing -IsRetry in these cases. Can you enable MSAL and see if it helps here? There's token caches enabled by default for MSAL (and work much better).
Ensure this gets enabled for all sessions:
export NUGET_CREDENTIALPROVIDER_MSAL_ENABLED=true
This did not worked in my case. However, setting the environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
in pwsh user's profile did the job.