How to handle service down case is Azure AD B2c.
See original GitHub issueHi, I am using Microsoft.Identity.Client version 4.22.0 in my Xamarin Forms application for Authentication. I have two questions related to handling of “The webpage is not available”. case.
Qn1 : Is there any way I can retry the login request if the service / B2c is down, after a specific time interval? Qn2: How I can comeback to the calling method if the service is down? So that I can provide a readable method to the user other than failed sign-in url.
I am calling the below methods for login and revalidating the existing token.
var result = await _authenticationClient.AcquireTokenInteractive(_settings.Scopes)
.WithParentActivityOrWindow(ParentActivityOrWindow)
.WithPrompt(Prompt.ForceLogin)
.WithUseEmbeddedWebView(true)
.WithExtraQueryParameters(AppIdentifier)
.ExecuteAsync();
var accounts = await _authenticationClient.GetAccountsAsync();
var authResult = await _authenticationClient.AcquireTokenSilent(_settings.Scopes, GetAccountByPolicy(accounts, _settings.SignInPolicy))
.ExecuteAsync();
And this is the situation I am trying to tackle.
Please help.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Is there a way to check if Azure B2C is down and generate ...
I understand that you are looking for a way to programmatically poll the service health of B2C service and generate automatic alerts from...
Read more >Troubleshoot Azure AD B2C custom policies and user flows
The user select Cancel button before authenticating to the identity provider itself. In this case, Azure AD B2C service returns error code ...
Read more >Best practices for Azure AD B2C - Active Directory
Stay up to date with Azure AD B2C product updates and announcements. File a support request for Azure AD B2C technical issues. Billing...
Read more >What is Azure Active Directory B2C?
Azure AD B2C is a customer identity access management (CIAM) solution capable of supporting millions of users and billions of authentications ...
Read more >Access and review audit logs - Azure AD B2C
To download Azure AD B2C audit log events via the API, filter the logs on the B2C category. To filter by category, use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @stezma -
I don’t think we have a good solution for this yet. The main mitigation developers use today is to detect if the network is down PRIOR to making a token request.
Generally timeouts in .NET world are done using the cancellation mechanism. Notice that
ExecuteAsync
accept a token. That said the library does not necessarily need to obey your cancellation request, either because it cannot or because the execution has reached a point where it’s too late to cancel.I think currently we do not react to cancellation in this case, but we probably should, by throwing an
OperationCancelledException
. Would this help? Does it maybe work today?@bgavrilMS yes, i think this is on our list of asks w/b2c. i’ll mark this as external.