How to fix Error 400: redirect_uri_mismatch, because of Google's OAuth 2.0 authorization change

Jitesh Acharya 0 Reputation points
2023-06-09T06:38:01.4633333+00:00

We are using Azure AD B2C along with MSAL sdk for native Android and iOS Applications. We have also configured google SSO(Sign In with google).

As per the instructions mentioned in Upcoming security changes to Google's OAuth 2.0 authorization endpoint in embedded webviews , we have modified the redirect URIs by going to Google cloud console -> Credentials -> Authorized redirect URIs.

As per the instruction given in Test for compatibility , we have added the query param "disallow_webview=true" to the redirect URIs.

After doing this we are getting the following error,

Screenshot 2023-06-09 at 12.05.32 PM

Please suggest the further steps on resolving this.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2023-06-12T07:22:48.0566667+00:00

    Hi @Jitesh Acharya

    Thanks for reaching out.

    This is a known scenario and if your apps authenticate users with an embedded web-view and you're using Google federation with Azure AD B2C, Google Gmail users won't be able to authenticate.

    You need to modify your apps to system web-views for authentication. All MSAL SDKs use the system browser by default.

    https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-net-web-browsers#system-web-browser-on-xamarinios-xamarinandroid

    Reference: https://learn.microsoft.com/en-us/azure/active-directory/external-identities/google-federation#deprecation-of-web-view-sign-in-support

    https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-net-xamarin-android-considerations#update-the-android-manifest

    Hope this will help.

    Thanks,

    Shweta


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

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.