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

Use interactive browser as the fallback for non azure cli users #281

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wyunchi-ms
Copy link
Collaborator

@wyunchi-ms wyunchi-ms commented Nov 7, 2024

For those users who doesn't logined with azure cli, use interactive browse as a fallback way to get user access token.

PR Summary

PR Context

@wyunchi-ms wyunchi-ms force-pushed the wyunchi/fallback-to-InteractiveBrowser branch from 5d0072c to 0c3429c Compare November 7, 2024 13:02
@@ -386,7 +387,8 @@ internal async Task CreateOrRenewTokenAsync(CancellationToken cancellationToken)

if (needRefresh)
{
_accessToken = await new AzureCliCredential()
_accessToken = await new ChainedTokenCredential(new AzureCliCredential(),
new InteractiveBrowserCredential(ApplicationId))
Copy link
Member

@daxian-dbw daxian-dbw Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea, but we will need to do a lot more:

  1. What about scenarios where browser is not available? Like when user is using AIShell on a remote machine via SSH connection. How do we detect that and switch to "device code" login?
  2. The error handling (e.g. error messages to help with mitigation) regarding access token failures will need to be updated accordingly.
  3. Maybe we should not recommend /replace when AzCLI is not installed. And we shouldn't recommend /code post for AzCLI commands when it's not installed.

I think we should revisit this post public preview, and will definitely need to involve PMs to think about the scenarios when AzCLI is not installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants