Azure AD B2C | MsalServiceException: ERR_BLOCKED_BY_RESPONSE

naeuurr 21 Reputation points
2022-10-18T13:31:29.047+00:00

Hi everyone,

I have mobile applications (Android / iOS) that are using Azure AD B2C for authentication. There are no issues until yesterday, it works as expected. But now when we try to load sign-in / sign-up pages, it gives MsalServiceException: ERR_BLOCKED_BY_RESPONSE error and redirects us without opening sign-in / sign-up pages. I am adding code snippet, why do I get this error? Market version was working until yesterday, what is occured now?

var b2cApp: IMultipleAccountPublicClientApplication? = null  
     activity?.let {  
                var ui_local = SharedPrefManager.getInstance(it.baseContext).getPreference(Constant.LANGUAGE) ?: Locale.getDefault().language  
                if(ui_local =="iw") ui_local = "he"  
      
                val extraQueryParameters: MutableList<android.util.Pair<String, String>> = ArrayList()  
                extraQueryParameters.add(android.util.Pair("ui_locales", ui_local))  
      
                val parameters = AcquireTokenParameters.Builder()  
                    .startAuthorizationFromActivity(it)  
                    .fromAuthority(B2CConfiguration.getAuthorityFromPolicyName(B2CConfiguration.Policies[flow.ordinal]))  
                    .withScopes(B2CConfiguration.scopes)  
                    .withPrompt(Prompt.LOGIN)  
                    .withAuthorizationQueryStringParameters(extraQueryParameters)  
                    .withCallback(authInteractiveCallback)  
                    .build()  
      
                b2cApp?.acquireToken(parameters)  
          }   
    }  
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,775 questions
{count} votes

Accepted answer
  1. Shweta Mathur 29,756 Reputation points Microsoft Employee
    2022-10-19T06:25:38.227+00:00

    Hi @naeuurr ,

    Thanks for reaching out.

    This error usually comes where most of the IDPs are not allowed to be rendered an iframe for login and logout.

    Updating the SDK version com.microsoft.identity.client:msal:2.2.3 will help to resolve the issue.

    Hope this will help.

    Thanks,
    Shweta

    -------------------------------------

    Please remember to "Accept Answer" if answer helped you.


0 additional answers

Sort by: Most helpful