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] Could not communicate with broker via content provider

See original GitHub issue

Logs and network traces

Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Access token has expired or about to expire. [Current time (06/11/2021 07:34:07) - Expiration Time (06/11/2021 06:49:44 +00:00) - Extended Expiration Time (06/11/2021 06:49:44 +00:00)]
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] [Region discovery] WithRegion not configured.
Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Azure region was not configured or could not be discovered. Not using a regional authority.
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] [Instance Discovery] Tried to use network cache provider for login.microsoftonline.com. Success? False. 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] [Instance Discovery] Tried to use known metadata provider for login.microsoftonline.com. Success? True. 
Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Refresh token found in the cache? - False
Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Checking ADAL cache for matching RT. 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] No Refresh Token was found in the cache. 
Warning	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Refreshing the RT failed. Is AAD down? False. Is there an AT in the cache that is usable? False 
Warning	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Failed to refresh the RT and cannot use existing AT (expired or missing). 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Token cache could not satisfy silent request. 
Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Attempting to use broker instead. 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07] [Android broker] Getting the Android context for broker request. 
Info	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07 - ] Can invoke broker. Will attempt to acquire token with broker. 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidContentProviderBroker:InitiateBrokerHandShakeAsync
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07] [Android broker] Found the Authenticator on the device. 
Debug	11-6-2021 09:34:07 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:07] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator in 21 ms
Info	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] [Android broker] Using broker protocol version: 3.0
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidContentProviderBroker:InitiateBrokerHandShakeAsync in 814 ms
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidContentProviderBroker:AcquireTokenSilentViaBrokerAsync
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] [Android broker] User is specified for silent token request. Starting silent request. 
Info	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] Enable PII to see the broker account bundle request. 
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] [Android broker] Found the Authenticator on the device. 
Debug	11-6-2021 09:34:08 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:08] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator in 29 ms
Info	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] [Android broker] Found broker account in Android account manager using the provided login hint. 
Debug	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:ValidateBrokerRedirectUri
Debug	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:ValidateBrokerRedirectUri in 14 ms
Info	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Info (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] Enable PII to see the silent broker request. 
Debug	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] ****** Starting D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator
Debug	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] [Android broker] Found the Authenticator on the device. 
Debug	11-6-2021 09:34:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:11] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidBrokerHelper:GetInstalledAuthenticator in 18 ms
Error	11-6-2021 09:34:15 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Error (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:15] [Android broker] An error occurred during the content provider operation.
Debug	11-6-2021 09:34:15 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Verbose (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:15] ****** Finished D:\a\1\s\src\client\Microsoft.Identity.Client\Platforms\Android\Broker\AndroidContentProviderBroker:AcquireTokenSilentViaBrokerAsync in 7269 ms
Error	11-6-2021 09:34:16 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Error (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 30 [06/11/2021 07:34:16] [Android broker] Silent invocation failed. Exception type: Microsoft.Identity.Client.MsalClientException
, ErrorCode: cannot_invoke_broker
Error	11-6-2021 09:34:16 +02:00	MsalClientException	[RequestTokenSilentAsync:132]MSAL.Xamarin.Android.4.30.1.0.MsalClientException: 
	ErrorCode: cannot_invoke_broker
Microsoft.Identity.Client.MsalClientException: [Android broker] Could not communicate with broker via content provider.
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidContentProviderBroker.PerformContentResolverOperationAsync (Microsoft.Identity.Client.Platforms.Android.Broker.ContentResolverOperation operation, System.String operationParameters) [0x00111] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidContentProviderBroker.AcquireTokenSilentFromBrokerInternalAsync (Microsoft.Identity.Client.Platforms.Android.Broker.BrokerRequest brokerRequest) [0x0008d] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidContentProviderBroker.AcquireTokenSilentViaBrokerAsync (Microsoft.Identity.Client.Platforms.Android.Broker.BrokerRequest brokerRequest) [0x00137] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidBrokerHelper.HandleBrokerOperationError (System.Exception ex) [0x00019] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidContentProviderBroker.AcquireTokenSilentInternalAsync (Microsoft.Identity.Client.Platforms.Android.Broker.BrokerRequest brokerRequest) [0x00093] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Platforms.Android.Broker.AndroidContentProviderBroker.AcquireTokenSilentAsync (Microsoft.Identity.Client.Internal.Requests.AuthenticationRequestParameters authenticationRequestParameters, Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenSilentParameters acquireTokenSilentParameters) [0x000f1] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.SendTokenRequestToBrokerAsync () [0x000b9] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00079] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00235] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync (System.Threading.CancellationToken cancellationToken) [0x0016a] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.ExecuteAsync (Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenCommonParameters commonParameters, Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenSilentParameters silentParameters, System.Threading.CancellationToken cancellationToken) [0x000d5] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Ns.Orp.Auth.AzureAd.Droid.Services.AzureAdAuthTokenProvider.RequestTokenSilentAsync (System.Collections.Generic.IEnumerable`1[T] scopes, Microsoft.Identity.Client.IAccount account, System.Threading.CancellationToken cancellationToken) [0x0008e] in <3637d31cd70b4b2b823bdfe9237daf14>:0 
  at Ns.Orp.Auth.AzureAd.Droid.Services.AzureAdAuthTokenProvider.RequestTokenSilentAsync (System.Collections.Generic.IEnumerable`1[T] scopes, System.String username, System.Threading.CancellationToken cancellationToken) [0x0016b] in <3637d31cd70b4b2b823bdfe9237daf14>:0 

Which version of MSAL.NET are you using? MSAL.NET 4.30.1

Platform Xamarin.Android

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Authentication
    • Username Password
    • Device code flow (browserless)
  • Web app
    • Authorization code
    • On-Behalf-Of
  • Daemon app
    • Service to Service calls

Is this a new or existing app? b. The app is in production, I haven’t upgraded MSAL, but started seeing this issue.

Repro We have several mobile apps that use Authenticator as a broker. We experience that some of our users unexpectedly have to log in again (interactive flow) for unknown reasons. One of the errors we see in the logging is: “Could not communicate with broker via content provider.”.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
trwalkecommented, Aug 31, 2021

@timdriever Yes I have them. looking into them and will get back to you by tomorrow

1reaction
bgavrilMScommented, Aug 3, 2021

We have an ongoing incident with the MSAL Android team, who are also responsible for the auth part of Authenticator. They are looking into this issue. @trwalke or myself will update the thread once we hear from them. I don’t think we need more info from you Tim.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] MsalClientException with error code ...
(False) MSAL 4.24.0.0 MSAL.Xamarin.Android 30 [02/14/2021 22:28:17] Error when trying to initiate communication with the broker.
Read more >
MsalError Class (Microsoft.Identity.Client)
Error code returned as a property in MsalException. ... Broker is configured with an ADFS authority, however, it does not support ADFS environments....
Read more >
Handle errors and exceptions in MSAL.NET
Learn how to handle errors and exceptions, Conditional Access claims challenges, and retries in MSAL.NET.
Read more >
Azure AD authentication troubleshooting: Known problems ...
And the reason the client application is broken is because it can only do legacy authentication OR it only has cached credentials which...
Read more >
Failed to connect to host (1010837)
vCenter Server cannot connect to a host when performing operations such as: Storage vMotion; Cold migration; Cloning a virtual machine ...
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