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

iOS Web Authentication Broker causes InvalidOperationException if dialog is cancelled. #19666

Open
Vespion opened this issue Mar 11, 2025 · 0 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@Vespion
Copy link

Vespion commented Mar 11, 2025

Current behavior

When using OIDC to authenticate on iOS, the system will show a dialog asking if the uses want's to use X website to login.

If the user presses the cancel button then the WebAuthenticationBrokerProvider will throw a InvalidOperationException with the message An attempt was made to transition a task to a final state when it had already completed.

Expected behavior

Cancelling this dialog should return an unauthenticated result without throwing an exception in the Main.iOS class.

How to reproduce it (as minimally and precisely as possible)

  • Add an OIDC configuration to the project config file
  • Run the project with the iOS head
  • Press the login button
  • When the dialog appears, press cancel
  • The InvalidOperationException will be thrown from the Main.iOS class

Minimal Repo
BugReport.zip

Workaround

Add a try catch statement to the Main.iOS class.
This will prevent the app immediately crashing out but is a bit of a kludge fix.

Works on UWP/WinUI

Yes

Environment

Uno.UI.DevServer / Uno.WinUI.DevServer, Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Packages installed using the SDK (version 5.6.70)

Affected platforms

iOS, Mac Catalyst

IDE

Rider macOS

IDE version

2024.3.6

Relevant plugins

No response

Anything else we need to know?

No response

@Vespion Vespion added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant