Skip to content

[Bug] Login page not shown completely on Android since v15 (API35) #5547

@SokoFromNZ

Description

@SokoFromNZ

Library version used

4.77.1

.NET version

.NET 9
VS 2022: 17.14.18
MAUI android workload: 35.0.105/9.0.100 SDK 9.0.300, VS 17.14.36616.10

Scenario

PublicClient - mobile app

Is this a new or an existing app?

The app is in production, I haven't upgraded MSAL, but started seeing this issue

Issue description and reproduction steps

When I login on my .NET MAUI app on Android the login screen is not shown completely since Android 15.

Image

Depending on the symbol and font size settings on the Android device even the input control is not shown anymore.
Focusing the intput control so the softkeyboard is shown does not bring/scroll the input into view.

I thought is has something to do with the Android.System.WebView version installed on the device rather than the android version. But on my Google Pixel 10 Pro with Android 16 I've installed the latest WebView version v141 (via Developer Tools), with v140 and also uninstalled all updates so I tested with v136. But the problem was the same.
On my Samsung Galaxy with Android 14, running WebView v140 everything is OK (looks like the left emulator in the screenshot).

Find attached (MSALAndroidLoginView.zip) a simple MAUI solution which shows the issue. Just make sure you set your ClientId, TenantId and AccessScope before debugging.

MSALAndroidLoginView.zip

Relevant code snippets

using Microsoft.Identity.Client;
using System;

namespace MSALAndroidLoginView;

public partial class MainPage
{
    private const string Instance = "https://login.microsoftonline.com";
    private const string ClientId = "<PUT YOURS HERE>";
    private const string TenantId = "<PUT YOURS HERE>";
    private const string AccessScope = "<PUT YOURS HERE>";

    private readonly IPublicClientApplication _publicClientApp;

    public MainPage()
    {
        InitializeComponent();
        _publicClientApp =
            PublicClientApplicationBuilder.Create(ClientId)
                .WithAuthority(Instance, TenantId)
                .WithDefaultRedirectUri()
                .Build();
    }

    private async void OnClicked(object? sender, EventArgs e)
    {
        var authResult = await _publicClientApp
            .AcquireTokenInteractive([AccessScope])
            .WithAccount(null)
            .WithParentActivityOrWindow(Microsoft.Maui.ApplicationModel.Platform.CurrentActivity)
            .WithUseEmbeddedWebView(true)
            .WithPrompt(Prompt.ForceLogin)
            .ExecuteAsync();
    }
}

Expected behavior

No response

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

No response

Solution and workarounds

I haven't found any. Please let me know if there is one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions