Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] iOS broker does not launch on IOS 18.0.1 #4958

Closed
stevencreaney opened this issue Oct 18, 2024 · 4 comments · Fixed by #4980
Closed

[Bug] iOS broker does not launch on IOS 18.0.1 #4958

stevencreaney opened this issue Oct 18, 2024 · 4 comments · Fixed by #4980

Comments

@stevencreaney
Copy link

Library version used

4.65.0

.NET version

8.0.403

Scenario

PublicClient - mobile app

Is this a new or an existing app?

This is a new app or experiment

Issue description and reproduction steps

This is a .Net MAUI app written for Windows/IOS. We are leveraging the sample code provided in the MSAL MAUI sample.

This code previously worked just fine, but until IOS18.0.1 and XCode 16, plus any of the relevant updates from the dotnet workloads and nuget packages, this is now consistent.

When executing AcquireTokenInteractiveAsync on PublicClientApplication, the Task never returns and the application hangs.

return await PublicClientApplication.AcquireTokenInteractive(scopes)
.WithLoginHint(existingAccount?.Username ?? string.Empty)
.WithSystemWebViewOptions(systemWebViewOptions)
.WithParentActivityOrWindow(PlatformConfiguration.Instance.ParentWindow)
.ExecuteAsync()
.ConfigureAwait(false);

The last line of logging is:

False MSAL 4.65.0.0 MSAL.Xamarin.iOS .NET 8.0.10 18.0.1 [2024-10-18 16:06:54Z] Invoking the iOS broker
False MSAL 4.65.0.0 MSAL.Xamarin.iOS .NET 8.0.10 18.0.1 [2024-10-18 16:06:54Z] iOS Broker Payload Count: 16
False MSAL 4.65.0.0 MSAL.Xamarin.iOS .NET 8.0.10 18.0.1 [2024-10-18 16:06:54Z] Starting waiting for broker response

We do see this in the device output:

BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(:) needs to migrate to the non-deprecated UIApplication.open(:options:completionHandler:). Force returning false (NO).

We noticed this appears to happen right here:

private async Task InvokeIosBrokerAsync(Dictionary<string, string> brokerPayload)

Relevant code snippets

return await PublicClientApplication.AcquireTokenInteractive(scopes) .WithLoginHint(existingAccount?.Username ?? string.Empty).WithSystemWebViewOptions(systemWebViewOptions).WithParentActivityOrWindow(PlatformConfiguration.Instance.ParentWindow).ExecuteAsync().ConfigureAwait(false);

Expected behavior

No response

Identity provider

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

Regression

No response

Solution and workarounds

Implement the suggested code updates for UIApplication.open() vs UIApplication.openURL().

@stevencreaney stevencreaney added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Oct 18, 2024
@bernardoif
Copy link

Hi,

I'm facing the same problem here, is there any fix or workaround ? I've been trying multiple approaches without success.

This happens to me on iOS 18.0 and iOS 18.0.1

@noka03
Copy link

noka03 commented Oct 28, 2024

Im having the same issue.
In my case the issue presented itself only after calling RemoveAsync ie:
await PublicClientApplication.RemoveAsync(user).ConfigureAwait(false);
After calling this I was no longer able to communicate with the Microsoft Authenticator (Broker)

@noka03
Copy link

noka03 commented Nov 5, 2024

This is holding up my project.
Thanks for the fix.
When is the next scheduled release?

@bgavrilMS
Copy link
Member

I am starting the release process, we will release in 1-2 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants