microsoft-authentication-library-for-dotnet icon indicating copy to clipboard operation
microsoft-authentication-library-for-dotnet copied to clipboard

[Bug] Identity Client doesnot allow to Select account

Open Arslan007 opened this issue 2 years ago • 4 comments

Library version used

4.57.0

.NET version

.NET 7 Win UI

Scenario

PublicClient - desktop app

Is this a new or an existing app?

This is a new app or experiment

Issue description and reproduction steps

On MAUI Windows App Microsoft Identity client doesnot show you select account option and directly takes you to Code screen. I believe it takes the logged in account information from windows and always consider that as main account but this behaviour donot allow the user to login with other account.

Screenshot 2023-10-21 at 1 12 25 PM Screenshot 2023-10-21 at 1 10 30 PM

Relevant code snippets

public async Task<AuthenticationResult> AcquireTokenInteractiveAsync(string[] scopes)
        {
            if (publicClientApplication == null)
                return null;

            try
            {
                return await publicClientApplication.AcquireTokenInteractive(scopes)
                                        .WithB2CAuthority(settings?.Authority)

#if __IOS__
                                        .WithParentActivityOrWindow(PlatformConfig.Instance.ParentWindow)
#endif
                                        .WithPrompt(Prompt.SelectAccount)
                                        .WithUseEmbeddedWebView(true)
                                        .ExecuteAsync()
                                        .ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                //Logging
                return null;
            }
        }

Expected behavior

It should allow user to select account on login screen

Identity provider

Azure B2C Basic Policy

Regression

No response

Solution and workarounds

No response

Arslan007 avatar Oct 21 '23 20:10 Arslan007

@pmaytak @bgavrilMS Can we expect any update on this issue or should we be logging this ticket via Azure Portal to prioritize this. Thanks

Arslan007 avatar Oct 29 '23 00:10 Arslan007

You should be opening the bug, as you'll be asked to provide more info etc.

bgavrilMS avatar Oct 30 '23 12:10 bgavrilMS

@Arslan007 - are you still encountering the issue with the latest version of MSAL.NET?

localden avatar Jul 09 '24 05:07 localden

@localden I will give a shot in the morning tomorrow.

Arslan007 avatar Jul 09 '24 05:07 Arslan007