Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

MsalCacheHelper.CreateAsync throws HttpRequestException when offline #123

Closed
FreddyDgh opened this issue Feb 1, 2021 · 2 comments · Fixed by #130
Closed

MsalCacheHelper.CreateAsync throws HttpRequestException when offline #123

FreddyDgh opened this issue Feb 1, 2021 · 2 comments · Fixed by #130
Labels
bug Something isn't working P2

Comments

@FreddyDgh
Copy link

Desired behavior
I would like to be able to read the accounts from the cache, even when the user does not have an internet connection. It is my understanding that this functionality works when using MSAL with token caches on other platforms. Is there any reason offline functionality should not be possible with the token cache provided in this repo?

Actual behavior
When I call MsalCacheHelper.CreateAsync, it throws a HttpRequestException with the message No such host is known.

Miscellaneous

  • The app I am using is a .NET 5.0 WPF app.
  • I am using version 2.16.7 of Microsoft.Identity.Client.Extensions.Msal
@bgavrilMS
Copy link
Member

What is your authority?

This is a valid bug, generally MSAL is able to perform GetAccount offline. As long as you connect to some known clouds, this should work offline. MSAL needs to go online if the are tokens in the cache for authorities it does not recognize.

@bgavrilMS bgavrilMS added bug Something isn't working P2 labels Feb 1, 2021
@FreddyDgh
Copy link
Author

I am using .WithB2CAuthority() with the form xxx.b2clogin.com.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants