Skip to content
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

[Azure Identity] Support auth code flow in WSL Ubuntu 18.04 #17615

Closed
jiasli opened this issue Mar 27, 2021 · 1 comment · Fixed by #17752
Closed

[Azure Identity] Support auth code flow in WSL Ubuntu 18.04 #17615

jiasli opened this issue Mar 27, 2021 · 1 comment · Fixed by #17752
Assignees

Comments

@jiasli
Copy link
Member

jiasli commented Mar 27, 2021

Test script:

from azure.identity import InteractiveBrowserCredential

InteractiveBrowserCredential().get_token('https://management.azure.com/.default')

This works in WSL Ubuntu 20.04, but fails in 18.04:

InteractiveBrowserCredential.get_token failed: Failed to open a browser
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    InteractiveBrowserCredential().get_token('https://management.azure.com/.default')
  File "/home/user2/env36/lib/python3.6/site-packages/azure/identity/_internal/interactive.py", line 136, in get_token
    result = self._request_token(*scopes, **kwargs)
  File "/home/user2/env36/lib/python3.6/site-packages/azure/identity/_internal/decorators.py", line 45, in wrapper
    return fn(*args, **kwargs)
  File "/home/user2/env36/lib/python3.6/site-packages/azure/identity/_credentials/browser.py", line 88, in _request_token
    raise CredentialUnavailableError(message="Failed to open a browser")
azure.identity._exceptions.CredentialUnavailableError: Failed to open a browser

Root cause and more info: AzureAD/microsoft-authentication-library-for-python#332

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 27, 2021
@chlowell chlowell added Azure.Identity and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Mar 29, 2021
@chlowell chlowell self-assigned this Mar 29, 2021
@chlowell
Copy link
Member

This works for me on 18.04.5, using either WSL 1 (4.4.0-19041-Microsoft) or 2 (5.4.72-microsoft-standard-WSL2). I don't know what the key difference between our environments could be; can you please add the output of lsb_release -a?

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants