-
Notifications
You must be signed in to change notification settings - Fork 341
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] MSAL .NET versions < 4.5.0 do not support system browser on iOS 13 #1399
Comments
I receive the same error, initially I thought it was for the version of the nuget package but even updating it to version 4.4.0 of MSAL the same error still occurs |
I updated to Xcode 11/iOS 13 last night, and my code is now also returning this error. Was working fine prior to the upgrade. |
We are having the same issue. Since Xcode update to 11 with iOS 13, now code that works on iOS 12 Emulator return authentication_canceled exception. Repro with Microsoft.Identity.client 4.3.1 and 4.4 |
@zachgreencbt @rulasg @andresbj16 @mtanml : does the iOS emulator have the latest version of Microsoft Authenticator? |
Also adding the Supportability tab as we'd want better error messages if possible than authentication_canceled. |
Mee too. I have the same problem. I update XCode and with the new simulator with IOS 13, not working. I update MSAL from 4.3.x to 4.4.0 and the problem is the same. |
@lperezj : does the new simulator have the latest Authenticator app? |
Same here, getting the authentication_cancelled error in simulator, still have to test on a phisical device |
I'm testing with IOS 13 simulator. If i test with IOS 12.2 simulator working fine. |
@jennyf19 : and it seems at at least some of the affected apps are B2C apps: |
On our case, same project as @lperezj, we are using a corp app using corporative AAD Tenant. |
My app is B2C |
If it helps, this sample from Microsoft has the same problem, https://github.com/Azure-Samples/active-directory-xamarin-native-v2 |
yes, @zachgreencbt, I've noticed your issue there: Azure-Samples/active-directory-xamarin-native-v2#84, and other confirmations |
Hello, Can you please provide the full information of your xamarin.iOS installation, would be good to know if this is happening with a package that support xcode11 or with an older one. The easiest way to get exact version information:
Then copy/paste the version information (you can use the "Copy Information" button). The Xcode version information will also be helpful since we have had several releases from Apple. (GM, GM2 or Xcode11 final). |
@mtanml @andresbj16 @zachgreencbt @rulasg (see above ^) Thanks @mandel-macaque |
Microsoft Visual Studio Professional 2019 Installed Version: Professional ADL Tools Service Provider 1.0 ASP.NET and Web Tools 2019 16.3.282.33872 ASP.NET Web Frameworks and Tools 2019 16.3.282.33872 Azure App Service Tools v3.0.0 16.3.282.33872 Azure Data Lake Node 1.0 Azure Data Lake Tools for Visual Studio 2.4.1000.0 Azure Functions and Web Jobs Tools 16.3.282.33872 Azure Stream Analytics Tools for Visual Studio 2.4.1000.0 C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Common Azure Tools 1.10 Extensibility Message Bus 1.2.0 (d16-2@8b56e20) Fabric.DiagnosticEvents 1.0 IntelliCode Extension 1.0 Microsoft Azure HDInsight Azure Node 2.4.1000.0 Microsoft Azure Hive Query Language Service 2.4.1000.0 Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Stream Analytics Language Service 2.4.1000.0 Microsoft Azure Stream Analytics Node 1.0 Microsoft Azure Tools 2.9 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Microsoft JVM Debugger 1.0 Microsoft Library Manager 2.0.83+gbc8a4b23ec Microsoft MI-Based Debugger 1.0 Microsoft Visual Studio Tools for Containers 1.1 Mono Debugging for Visual Studio 16.3.7 (9d260c5) NuGet Package Manager 5.3.0 ProjectServicesPackage Extension 1.0 Redgate SQL Change Automation 4.0.19255.10541 Visit https://www.red-gate.com/sca/productpage for more information. Copyright (C) 2011 Red Gate Software Ltd. All rights reserved. This software contains components from Component Owl. SQL Change Automation contains code from the following open source software: NuGet https://www.nuget.org/ This product contains icons from http://www.visualpharm.com distributed under a free backlink license. For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the SQL Change Automation application folder. Redgate SQL Prompt 9.5.15.11225 SQL Server Data Tools 16.0.61908.27190 SQL Server Reporting Services 15.0.1484.0 ToolWindowHostedEditor 1.0 TypeScript Tools 16.0.10821.2002 Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Visual Studio Code Debug Adapter Host Package 1.0 Visual Studio Tools for Containers 1.0 Visual Studio Tools for Kubernetes 1.0 VisualStudio.Mac 1.0 Xamarin 16.3.0.274 (d16-3@06531f8) Xamarin Designer 16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670) Xamarin Templates 16.3.565 (27e9746) Xamarin.Android SDK 10.0.0.43 (d16-3/8af1ca8) Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208) |
@mtanml thanks, that is the correct xamarin.ios for xcode11, we will try to reproduce it in the xamarin-ios side to try and get to the bottom of the issue. |
Microsoft Visual Studio Professional 2019 Installed Version: Professional Visual C++ 2019 00435-20150-13783-AA224 ADL Tools Service Provider 1.0 Application Insights Tools for Visual Studio Package 9.1.00913.1 ASP.NET and Web Tools 2019 16.3.282.33872 ASP.NET Web Frameworks and Tools 2019 16.3.282.33872 Azure App Service Tools v3.0.0 16.3.282.33872 Azure Data Lake Node 1.0 Azure Data Lake Tools for Visual Studio 2.3.9000.0 Azure Functions and Web Jobs Tools 16.3.282.33872 Azure Stream Analytics Tools for Visual Studio 2.3.9000.0 C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Common Azure Tools 1.10 Extensibility Message Bus 1.2.0 (d16-2@8b56e20) Fabric.DiagnosticEvents 1.0 GitFlow.VS.Extension 1.0 IntelliCode Extension 1.0 Microsoft Azure HDInsight Azure Node 2.3.9000.0 Microsoft Azure Hive Query Language Service 2.3.9000.0 Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Stream Analytics Language Service 2.3.9000.0 Microsoft Azure Stream Analytics Node 1.0 Microsoft Azure Tools 2.9 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Microsoft JVM Debugger 1.0 Microsoft Library Manager 2.0.83+gbc8a4b23ec Microsoft MI-Based Debugger 1.0 Microsoft Visual C++ Wizards 1.0 Microsoft Visual Studio Tools for Containers 1.1 Microsoft Visual Studio VC Package 1.0 Mono Debugging for Visual Studio 16.3.7 (9d260c5) NuGet Package Manager 5.3.0 ProjectServicesPackage Extension 1.0 SQL Server Data Tools 16.0.61908.27190 ToolWindowHostedEditor 1.0 TypeScript Tools 16.0.10821.2002 Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Visual Studio Code Debug Adapter Host Package 1.0 Visual Studio Tools for Containers 1.0 Visual Studio Tools for Kubernetes 1.0 VisualStudio.Mac 1.0 Windows Template Studio 3.4.19254.1 Xamarin 16.3.0.274 (d16-3@06531f8) Xamarin Designer 16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670) Xamarin Templates 16.3.565 (27e9746) Xamarin.Android SDK 10.0.0.43 (d16-3/8af1ca8) Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208) |
Yes, I have the latest version of MSAL I have not verified on a physical device to see if the same thing happens as soon as I have this analysis I will share them |
My app is initially B2E, the authentication issue is addressed with azure active directory |
Visual Studio Enterprise 2019 for Mac
Mono Framework MDK NuGet SDK de .NET Core .NET Core Runtime Xamarin.Profiler Updater Apple Developer Tools Xamarin.Mac Xamarin.iOS Xamarin Designer Xamarin.Android Versión de SDK Tools: 26.1.1 Información de compilación: Microsoft Mobile OpenJDK Android SDK Manager Android Device Manager Xamarin Inspector Build Information Operating System |
Hi, I have the same problem, but on the Simulator and on my physical device. Which Version of MSAL are you using ? Platform What authentication flow has the issue? Is this a new or existing app? Test devices Possible Solution or Workaround
On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item. Microsoft Visual Studio Community 2019 Installed Version: Community Visual C++ 2019 00435-60000-00000-AA416 ADL Tools Service Provider 1.0 ASP.NET and Web Tools 2019 16.3.283.64955 ASP.NET Web Frameworks and Tools 2019 16.3.283.64955 Azure App Service Tools v3.0.0 16.3.283.64955 Azure Data Lake Node 1.0 Azure Data Lake Tools for Visual Studio 2.4.1000.0 Azure Functions and Web Jobs Tools 16.3.283.64955 Azure Stream Analytics Tools for Visual Studio 2.4.1000.0 C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Common Azure Tools 1.10 Extensibility Message Bus 1.2.0 (d16-2@8b56e20) Fabric.DiagnosticEvents 1.0 IntelliCode Extension 1.0 Microsoft Azure HDInsight Azure Node 2.4.1000.0 Microsoft Azure Hive Query Language Service 2.4.1000.0 Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Stream Analytics Language Service 2.4.1000.0 Microsoft Azure Stream Analytics Node 1.0 Microsoft Azure Tools 2.9 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Microsoft JVM Debugger 1.0 Microsoft Library Manager 2.0.83+gbc8a4b23ec Microsoft MI-Based Debugger 1.0 Microsoft Visual C++ Wizards 1.0 Microsoft Visual Studio Tools for Containers 1.1 Microsoft Visual Studio VC Package 1.0 Mono Debugging for Visual Studio 16.3.7 (9d260c5) Node.js Tools 1.5.10807.1 Commit Hash:4d3cf548113f5a53a02d83a877ee24e764b2cde4 NuGet Package Manager 5.3.0 Office Developer Tools for Visual Studio 16.0.29217.00 ProjectServicesPackage Extension 1.0 SQL Server Data Tools 16.0.61908.27190 ToolWindowHostedEditor 1.0 TypeScript Tools 16.0.10821.2002 Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Visual Studio Code Debug Adapter Host Package 1.0 Visual Studio Tools for Containers 1.0 Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Unity 4.3.3.0 VisualStudio.Mac 1.0 Web Accessibility Checker 1.5.58 Workflow Manager Tools 1.0 1.0 Xamarin 16.3.0.274 (d16-3@06531f8) Xamarin Designer 16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670) Xamarin Templates 16.3.565 (27e9746) Xamarin.Android SDK 10.0.0.43 (d16-3/8af1ca8) Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208) On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button. === Visual Studio Community 2019 for Mac === Version 8.3 (build 1805) Package version: 604000198 === Mono Framework MDK === Runtime: === NuGet === Version: 5.3.0.6192 === .NET Core SDK === SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks === .NET Core-Runtime === Laufzeit: /usr/local/share/dotnet/dotnet === Xamarin.Profiler === Version: 1.6.11.16 === Updater === Version: 11 === Xamarin.Android === Version: 10.0.0.43 (Visual Studio Community) Version von SDK Tools: 26.1.1 Buildinformationen: === Microsoft Mobile OpenJDK === Java SDK: /Users/stephan/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 === Android SDK Manager === Version: 1.4.0.65 === Android Device Manager === Version: 1.2.0.115 === Apple Developer Tools === Xcode 11.0 (14936) === Xamarin.Mac === Version: 6.2.0.42 (Visual Studio Community) === Xamarin.iOS === Version: 13.2.0.42 (Visual Studio Community) === Xamarin Designer === Version: 16.3.0.230 === Xamarin Inspector === Version: 1.4.3 === Build Information === Release ID: 803001805 === Operating System === Mac OS X 10.14.6 Additional context/ Logs / Screenshots I have not tried to remove the Authenticator App as suggested here: If you need additional information please advise how to obtain them. |
@stephan14x can you provide logs for the device + authenticator case? |
@jennyf19 how do I create the logs you need? preferable from Visual Studio on Windows (Device connected with USB to Mac) any help appreciated |
@WilliamWatterson86 are you sure that the nuget packages were well restored/updated? cc: @bgavrilMS |
Should I raise a new issue for it? |
If this is what I think it is, it's more a visual studio or Xamarin issue. |
@WilliamWatterson86 this happened to another customer with an adal package...be had to clear the nuget cache and then things worked, but clearing it also didn't completely clear it. He and to restart everything as well. This was a VS issue as @jmprieur points out. |
@jennyf19 @jmprieur - I cleared out the Nuget cache (Tools -> Options -> NuGet Package Manager -> Clear All NuGet Cache(s)), deleted bin and obj folders, restarted machine and still having the same issue. Checked the Android csproj and have the following in there:
Downgrading to 4.4.0 or 4.3.1 work no probs. |
@WilliamWatterson86 - do your xamarin projects still use packages.config? If they do, you'll need to migrate to PackageReference. |
@bgavrilMS - nope they all use PackageReference - no package.config files in solution |
Are you getting this at runtime or at buildtime? What linker options does your Android project use? |
@bgavrilMS this issue only appears at run time. The project builds no problem. |
I just tried to create a new Xamarin app and configure MSAL from the Android head and this seemed to have worked fine. I am using VS 2019 (on Windows) latest version and an Android Emulator. |
Really weird - I created a blank Xamarin Forms app and added the Microsoft.Identity.Client nuget and I get the same error as soon as it starts up too... VS 16.3.5 UNHANDLED EXCEPTION: |
You're on a newer version of VS than I am, the update must have just come out. Let me upgrade. |
I thought that might have been it too since I only updated VS this morning - but I tried on another dev's machine who is on an earlier version of VS 2019 and the same error occurred. |
Did you install the Microsoft.Identity.Client from nuget then? v4.5.0? |
Yes, I have the exact version of VS and xamarin SDKs as you do now. I am using an Android emulator. The exception seems to suggest that there is an issue with the android resource file. This is a cs file that is generated and there were some bugs in the past where VS would not re-generate it. Still, very strange that I am not able to repro this. |
This is a blank app using the VS2019 template and I have added the MSAL library |
I can repro with your app! Investigating. |
Ok great - just noticed that the Resource.designer.cs does not have any entries for Microsoft.Identity.Client in versions 4.4.0 and 4.3.1 - but when I add in reference to 4.5.0 I get loads of these in the Resource.designer.cs - so it looks like these are new? global::Microsoft.Identity.Client.Ref.Resource.Animation.abc_fade_in = global::App4.Droid.Resource.Animation.abc_fade_in; ... list continues ... |
Resources.designer.cs is generated by the build. I'm looking into the DLL with a dissasembler and I can see that in 4.4. there is no Resource class, while there is indeed a resource class in 4.5 |
Ok thanks @bgavrilMS |
I have a potential workaround - downgrade MSAL to 4.4 on the Android head but keep the iOS at 4.5. You can also keep the shared project at 4.5, it doesn't really matter. At runtime, the Android will use MSAL 4.4 and iOS will use MSAL 4.5. This should be fine because the 4.5 release has virtually no impact on Android code paths. |
Ok great thanks @bgavrilMS - sounds good let me try that here |
@bgavrilMS - just to confirm I tried that and it seems to work no problem - Android app loads and can log in etc. Thanks for your help :) |
Thanks for confirming @WilliamWatterson86, now for the fun part of hunting down obscure Xamarin build bugs :) |
@bgavrilMS I think we should open a separate issue for this. What do you think? |
@bgavrilMS @jennyf19 yes I agree. Let's open a different one (this one is fixed) |
Tracking the typeload exception here: #1449 |
If you are using the system browser with iOS 13, please update to MSAL.NET 4.5.0, which uses the required presentation context when authenticating on system browser with iOS 13.
If you are not using 4.5.0+, you will run into the issue listed below:
Starting with iOS 13, when authenticating using the system browser, MSAL .NET is required to provide a presentation context when using
ASWebAuthenticationSession
. Apple added multi-window support, and therefore they need to specifically know where to present the context (this is a breaking change).In iOS 12, the AuthenticationSession API was iOS only and apps drew into a single window. However, now, with iPadiOS and macOS support, MSAL .NET will need to give the session a presentationContextProvider, and that presentationContextProvider will provide a window via the PresentationAnchor method.
Customer impact
Your app is impacted if all of the below are true:
Workaround
Or,
Example:
Notable Concerns Regarding the Workaround to Use the Embedded Webview
========
Which Version of MSAL are you using ?
MSAL 4.4.0 (also occurs in 4.3.1)
Platform
Xamarin iOS
What authentication flow has the issue?
Other? - please describe;
Is this a new or existing app?
The app is in production, and works fine on physical iOS devices (on both iOS 12.x and 13.0). I have upgraded my iPhone emulator to iOS 13, and that is where the issue occurs. Everything still works fine in iOS 12.2 on the emulator.
Repro
Expected behavior
Authentication process initiates
Actual behavior
Immediately returns "authentication_canceled"
Possible Solution
Additional context/ Logs / Screenshots
The text was updated successfully, but these errors were encountered: