Skip to content

Commit d9ae44d

Browse files
authored
Edit review
1 parent 4faa2c6 commit d9ae44d

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

support/entra/entra-id/app-integration/android-app-authentication-fails-after-published-to-google-play-store.md

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,63 @@
11
---
2-
title: Android app authentication fails after published to Google Play Store
3-
description: Provides a solution to an authentication failure with an Android app that's published to Google Play Store.
2+
title: Android App Authentication Fails After Being Published to Google Play Store
3+
description: Provides a solution to an authentication failure with an Android app that's published to the Google Play Store.
44
ms.reviewer: markbukovich, v-weizhu
55
ms.service: entra-id
66
ms.date: 02/19/2025
77
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
88
---
9-
# Authentication failed after Android app is published to Google Play Store
9+
# Authentication fails after an Android app is published to the Google Play Store
1010

11-
This article provides a solution to an authentication failure that occurs during signing in after users install an Android app that's published to Google Play Store.
11+
This article provides a solution to an authentication failure that occurs during signing in after users install an Android app that's published to the Google Play Store.
1212

1313
## Symptoms
1414

1515
Consider the following scenario:
1616

17-
- You have successfully implemented Microsoft Entra Authentication in your Android app with the Microsoft Authentication Library.
18-
- The app has been built and executed, and passed all QA testing.
19-
- You publish the app to Google Play Store.
17+
- You have successfully implemented Microsoft Entra authentication in your Android app with the Microsoft Authentication Library (MSAL).
18+
- The app has been built and executed and has passed all QA testing.
19+
- You publish the app to the Google Play Store.
2020

2121
After users install the app, authentication doesn't work when signing in to the app.
2222

23-
If you expose authentication error messages to users or if you let them send error messages to your team, you may encounter an error message like the following text:
23+
If you expose authentication error messages to users, or if you let them send error messages to your team, you may encounter an error message like the following text:
2424

2525
> The redirect URI in the configuration file doesn't match with the one generated with the package name and signature hash. Please verify the uri in the config file and your app registration in Azure portal.
2626
27-
Another possible scenario of this issue is:
27+
Another possible scenario for this issue is:
2828

29-
During development and QA testing, you set up your app to use a supported broker to handle authentication and SSO.
30-
31-
However, after the app deployment through Google Play and installation, the app no longer uses the broker for authentication.
29+
During development and QA testing, you set up your app to use a supported broker to handle authentication and single sign-on (SSO). However, after the app is deployed through Google Play and installed, the app no longer uses the broker for authentication.
3230

3331
## Cause
3432

35-
When an Android application is built for installation on a device, it is built as an APK compressed package and then signed by a certificate. This certificate signing ensures that the person who built the application is the one who owns the private signing key. This prevents hackers from modifying the application harmfully, as they can't sign their version with the original private key.
33+
When an Android application is built for installation on a device, it's built as an APK compressed package and then signed by a certificate. This certificate signing ensures that the person who built the application is the one who owns the private signing key. This prevents hackers from making harmful modifications to the application, as they can't sign their versions with the original private key.
3634

37-
Previously, Android developers owned and maintained their private signing keys. Currently, Google Play Services generate and maintain the private signing key for Android developers, ensuring secure storage by Google. The developer still maintains an upload key so that Google Play Services can verify the authenticity of an uploaded app bundle, but the actual signing is performed by the Google-owned signing certificate when users install the app on their device.
35+
Previously, Android developers owned and maintained their private signing keys. Currently, Google Play Services generates and maintains the private signing key for Android developers, ensuring secure storage by Google. The developer still maintains an upload key so that Google Play Services can verify the authenticity of an uploaded app bundle, but the actual signing is performed by the Google-owned signing certificate when users install the app on their devices.
3836

39-
The Microsoft Authentication Library (MSAL) for Android Native and Microsoft Supported Authentication Brokers use the public signature hash of an installed application to identify it when interacting through the Android Operating system during authentication.
37+
The MSAL for Android Native and Microsoft Supported Authentication Brokers use the public signature hash of an installed application to identify it when interacting with the Android operating system during authentication.
4038

41-
The public signature hash of an application installed via Google Play differs from one installed before publishing to Google Play. Thus, MSAL will be configured with the incorrect signature hash.
39+
The public signature hash of an application installed via Google Play differs from the one installed before publishing to Google Play. Thus, MSAL will be configured with the incorrect signature hash.
4240

4341
## Solution
4442

4543
To resolve this issue, do the following things:
4644

47-
- [Get the new signature hash with the MSAL Package Inspector tool or from the Google Play Console](#get-the-new-signature-hash-with-the-msal-package-inspector-tool-or-from-the-google-play-console).
45+
- [Get a new signature hash with the MSAL Package Inspector tool or from the Google Play Console](#get-a-new-signature-hash-with-the-msal-package-inspector-tool-or-from-the-google-play-console).
4846
- [Add a new redirect URI to the app registration in the Azure portal with the new signature hash](#add-a-new-redirect-uri-to-the-app-registration-in-the-azure-portal-with-the-new-signature-hash).
4947
- [Update the MSAL configuration within the application code to use the new redirect URI and signature hash](#update-the-msal-configuration-within-the-application-code-to-use-the-new-redirect-uri-and-signature-hash).
5048

51-
### Get the new signature hash with the MSAL Package Inspector tool or from the Google Play Console
49+
### Get a new signature hash with the MSAL Package Inspector tool or from the Google Play Console
5250

53-
You can get the new signature hash by using the MSAL Package Inspector tool or from the Google Play Console.
51+
You can get a new signature hash by using the MSAL Package Inspector tool or from the Google Play Console.
5452

5553
To install and use the MSAL Package Inspector, see [Package Inspector for MSAL Android Native Guide](https://blogs.aaddevsup.xyz/2022/03/package-inspector-for-msal-android-native-guide/).
5654

5755
To get the signature hash from the Google Play Console, follow these steps:
5856

5957
1. Go to the Google Play Console and sign in with your Google Developer account.
60-
2. Once you are in the Google Play Console, select the affected app.
58+
2. Once you're in the Google Play Console, select the affected app.
6159
3. On the left navigation, under the **Release** category, expand **Setup** and select **App Integrity**.
62-
4. Select the **App signing** tab. You will see the fingerprint of the app signing key in three different variations.
60+
4. Select the **App signing** tab. You'll see the fingerprint of the app signing key in three different variations.
6361
5. Copy the **SHA-1 certificate fingerprint** and paste it into the PowerShell script in step 6 as the value of the `$Thumbprint` variable.
6462
6. Run the following script to obtain the base64 encoded fingerprint that MSAL needs:
6563

@@ -78,26 +76,26 @@ To get the signature hash from the Google Play Console, follow these steps:
7876
Write-Host $hashedString
7977
```
8078
81-
:::image type="content" source="media/android-app-authentication-fails-after-published-to-google-play-store/google-play-console-app-signing.png" alt-text="Screenshot that shows how to get the signature hash from Google Play Console.":::
79+
:::image type="content" source="media/android-app-authentication-fails-after-published-to-google-play-store/google-play-console-app-signing.png" alt-text="Screenshot that shows how to get the signature hash from the Google Play Console." lightbox="media/android-app-authentication-fails-after-published-to-google-play-store/google-play-console-app-signing.png":::
8280
8381
### Add a new redirect URI to the app registration in the Azure portal with the new signature hash
8482
8583
> [!NOTE]
86-
> We recommend adding a new redirect URI rather than modifying the existing one. Your app registration can contain many redirect URIs. Additionally, modifying the existing redirect URI might result in problems with the development version of your app. This could cause issues during troubleshooting, developing updates, and so on.
84+
> We recommend adding a new redirect URI rather than modifying the existing one. Your app registration can contain many redirect URIs. Additionally, modifying the existing redirect URI might result in problems with the development version of your app. This can cause issues during troubleshooting, development updates, and so on.
8785
8886
1. Sign in to the Azure portal and navigate to the **App registrations** page.
8987
2. Select the app registration for your Android app.
9088
3. Under **Manage**, select **Authentication**.
9189
4. Under **Platform configurations**, select **Add a platform**.
9290
5. Under **Configure platforms**, select **Android**.
9391
94-
:::image type="content" source="media/android-app-authentication-fails-after-published-to-google-play-store/app-reg-platform-config.png" alt-text="Screenshot that shows how to configure Android platform.":::
95-
6. Enter the package name of your Android app. Also generate and enter the signature hash.
92+
:::image type="content" source="media/android-app-authentication-fails-after-published-to-google-play-store/app-reg-platform-config.png" alt-text="Screenshot that shows how to configure the Android platform.":::
93+
6. Enter the package name of your Android app. Also, generate and enter the signature hash.
9694
9795
:::image type="content" source="media/android-app-authentication-fails-after-published-to-google-play-store/app-registrations-configure-android-app.png" alt-text="Screenshot that shows how to configure an Android app.":::
9896
9997
> [!NOTE]
100-
> It's fine to use the same package name in multiple Android Redirect URIs as long as the signature hash is different.
98+
> It's fine to use the same package name in multiple Android redirect URIs as long as the signature hash is different.
10199
7. Select **Configure** to complete the platform configuration.
102100
103101
### Update the MSAL configuration within the application code to use the new redirect URI and signature hash
@@ -132,7 +130,7 @@ Update the MSAL configuration file and Android Manifest file in the application
132130
133131
- Android Manifest file:
134132
135-
Only change the `android:path` property in the `com.microsoft.identity.client.BrowserTabActivity` activity. Paste the signature hash as the value for this property.
133+
Only change the `android:path` property in the `com.microsoft.identity.client.BrowserTabActivity` activity. Paste the signature hash as the value of this property.
136134
137135
```xml
138136
<activity
@@ -151,7 +149,7 @@ Update the MSAL configuration file and Android Manifest file in the application
151149
152150
153151
> [!NOTE]
154-
> - Make sure to include the forward slash at the front of the signature hash.
152+
> - Make sure to include the forward slash in front of the signature hash.
155153
> - Unlike the redirect URI, the signature hash here isn't HTTP encoded.
156154
157155

support/entra/entra-id/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
items:
5252
- name: IDX10501 Error in ASP.NET Core with Azure B2C Custom Policy
5353
href: app-integration/troubleshoot-error-idx10501-aspnet-b2c.md
54-
- name: Authentication doesn't work after Android app is published to Google Play Store
54+
- name: Authentication fails after Android app is published to Google Play Store
5555
href: app-integration/android-app-authentication-fails-after-published-to-google-play-store.md
5656
- name: WIF10201 No valid key mapping found
5757
href: app-integration/troubleshoot-wif10201-no-validkey-securitytoken-mvc.md

0 commit comments

Comments
 (0)