-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh token expires daily on WSL Ubuntu installation #28040
Comments
Hi @austintolani, 2.53.1 is not the latest Azure CLI(2.55.0). If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
@austintolani, could you share the error message you get? Also, are you using device code flow in WSL? We got cases reported before that the refresh token retrieved using device code only works for ~12h in Microsoft tenant. |
Hi @jiasli, this is the error message I get:
I was using device code flow in WSL as I was having issues using the browser but was able to fix it using this solution. I will let you know tomorrow if using the browser flow fixes this issue. |
Using the browser authentication flow fixed this issue for me. Ideally, the refresh token should behave the same regardless of authentication flow but I will leave it up to you if that is worth keeping this issue open for. Thanks for your help! |
@austintolani, could you share more details about the issue you are facing? Currently, there is indeed an open issue for opening a web browser in WSL 2:
Yes, auth code flow / browser authentication flow is the recommended login method. |
Sure. When I run
And then the w3m browser is opened which I am not familiar with how to use. In previous versions, running |
randal [ ~ ]$ az aro create --resource-group $RESOURCEGROUP --name $CLUSTER --vnet aro-vnet --master-subnet master-subnet --worker-subnet worker-subnet The command failed with an unexpected error. Here is the traceback: The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I am using the latest cli version |
Describe the bug
I use Az CLI inside of Ubuntu 22.04.3 inside of a Windows machine running WSL. After ~12 hours or so, my refresh token will expire and I will have to run
az login
and authenticate again.On the same machine, I have Az CLI installed in Windows. With the same Azure account, I am only prompted to re-authenticate every couple of months.
My understanding is that refresh token expiry time is set by organizational policy. What explains the difference in behavior between the installation of Azure CLI on Windows and within Ubuntu is WSL? Is there any configuration change I can make to fix the behavior within the Ubuntu installation?
Related command
az login
Errors
n/a
Issue script & Debug output
n/a
Expected behavior
I expect that the frequency at which I am prompted to login is consistent across installations.
Environment Summary
Additional context
No response
The text was updated successfully, but these errors were encountered: