question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Editing and saving profile clears cached accounts

See original GitHub issue

Which Version of MSAL are you using ? Microsoft.Identity.Client 4.18.0

Platform .NET Standard 2.0, .NET Framework 4.6.1, WPF

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive B2C

Is this a new or existing app? The app is in production but updated MSAL version and changed areas of code and are now re-testing.

Repro

var ar = await pca.AcquireTokenInteractive(this.scopes)
    .WithAccount(account)
    .WithB2CAuthority(AuthB2C.AuthorityEditProfile)
    .WithParentActivityOrWindow(parentActivity)
    .WithPrompt(Prompt.NoPrompt)
    .ExecuteAsync();

Expected behavior Saving a profile, closing my app and then restarting will remember the cached user and allow AcquireTokenSilent to succeed.

Actual behavior

var accounts = await pca.GetAccountsAsync();

Saving a profile, close my app. Restart and try and get the accounts via the call above but they are empty. Requires the user to reauth via AcquireTokenInteractive.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RhomGitcommented, Sep 4, 2020

I honestly couldn’t tell you as it has been such a long time (more than a year at the very least). Its a feature that you add in and then never test again until a user reports an issue (or a developer misclicks “Sign Out” and then recognises an issue hehe).

1reaction
RhomGitcommented, Sep 4, 2020

Hi Jenny,

this particular issue is on Windows desktop (I haven’t tested other platforms). The iOS bit is in there because I share the MSAL portion of my code across many projects (including a Xamarin Forms mobile app) … and yes, I need to update the keychain group to my own 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Cached Credentials Have Expired. Please Sign In" error - ...
Quit all Office apps. Go to Control Panel>User Accounts>Credential Manager>Windows Credentials>Generic Credentials>remove all credentials ...
Read more >
Cached domain logon information - Windows Server
Through the Registry Editor or a Registry Console Tool (reg.exe), you can change the number of previous logon attempts that a server will...
Read more >
Office 365 cached credentials : r/sysadmin
Any Microsoft account saved in the windows settings ... Office 365 Client Deployment wizard, getting this error now when trying to open the ......
Read more >
How can I clear cached domain credentials?
David Yu's answer is pretty much on-target, but there is a way to do this without editing the registry directly.
Read more >
Incorrect login user is remembered and cannot be removed
Issue Type: Bug My employer has an Azure SQL DB. ... Simplest fix: tell me where/how I can delete saved credentials from ADS....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found