Issues with Auth0 client nuget on ios Xamarin

I recently updated to the lastest version of BigSur for mac and now im having this issue with the nuget client for the xamarin ios app.

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: The provided scheme is not valid. A scheme should not include special characters such as ":" or "/".

I can confirm that this is a breaking issue. I’m not able to use the product. I’ve updated to the latest versions of the nuget and still experience the issue. I’m including the full stack trace for diagnostics.

at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:407
at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/runtime/Delegates.generated.cs:126
at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr(intptr,intptr,intptr,intptr,intptr)
at AuthenticationServices.ASWebAuthenticationSession…ctor (Foundation.NSUrl url, System.String callbackUrlScheme, AuthenticationServices.ASWebAuthenticationSessionCompletionHandler completionHandler) [0x0004c] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/AuthenticationServices/ASWebAuthenticationSession.g.cs:100
at Auth0.OidcClient.ASWebAuthenticationSessionBrowser.Start (IdentityModel.OidcClient.Browser.BrowserOptions options, Auth0.OidcClient.ASWebAuthenticationSessionOptions sessionOptions) [0x0002a] in :0
at Auth0.OidcClient.AutoSelectBrowser.Launch (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x0000f] in :0
at Auth0.OidcClient.IOSBrowserBase.InvokeAsync (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x0003a] in :0
at IdentityModel.OidcClient.AuthorizeClient.AuthorizeAsync (IdentityModel.OidcClient.AuthorizeRequest request, System.Threading.CancellationToken cancellationToken) [0x000c9] in C:\local\identity\model\IdentityModel.OidcClient\src\AuthorizeClient.cs:63
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr(intptr,intptr,intptr,intptr,intptr)
at AuthenticationServices.ASWebAuthenticationSession…ctor (Foundation.NSUrl url, System.String callbackUrlScheme, AuthenticationServices.ASWebAuthenticationSessionCompletionHandler completionHandler) [0x0004c] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/AuthenticationServices/ASWebAuthenticationSession.g.cs:100
at Auth0.OidcClient.ASWebAuthenticationSessionBrowser.Start (IdentityModel.OidcClient.Browser.BrowserOptions options, Auth0.OidcClient.ASWebAuthenticationSessionOptions sessionOptions) [0x0002a] in :0
at Auth0.OidcClient.AutoSelectBrowser.Launch (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x0000f] in :0
at Auth0.OidcClient.IOSBrowserBase.InvokeAsync (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x0003a] in :0
at IdentityModel.OidcClient.AuthorizeClient.AuthorizeAsync (IdentityModel.OidcClient.AuthorizeRequest request, System.Threading.CancellationToken cancellationToken) [0x000c9] in C:\local\identity\model\IdentityModel.OidcClient\src\AuthorizeClient.cs:63
at IdentityModel.OidcClient.OidcClient.LoginAsync (IdentityModel.OidcClient.LoginRequest request, System.Threading.CancellationToken cancellationToken) [0x00111] in C:\local\identity\model\IdentityModel.OidcClient\src\OidcClient.cs:73
at Auth0.OidcClient.Auth0ClientBase.LoginAsync (System.Object extraParameters, System.Threading.CancellationToken cancellationToken) [0x000f3] in :0
at WeSub.iOS.Services.AuthenticationService.LoginAsync () [0x0002f] in /Users/lhughey/Source/WeSub/WeSub/WeSub.iOS/Services/AuthenticationService.cs:28
at WeSub.Authentication.Interfaces.CurrentSession.Login () [0x00050] in /Users/lhughey/Source/WeSub/WeSub.Authentication/Interfaces/ICurrentSession.cs:200
at WeSub.Authentication.ViewModels.LoginSignUpPageViewModel.SetUserTypeAndLoginCommandExecute (System.String userType) [0x00073] in /Users/lhughey/Source/WeSub/WeSub.Authentication/ViewModels/LoginSignUpPageViewModel.cs:87
at WeSub.Authentication.ViewModels.LoginSignUpPageViewModel.<.ctor>b__44_1 (System.String a) [0x00025] in /Users/lhughey/Source/WeSub/WeSub.Authentication/ViewModels/LoginSignUpPageViewModel.cs:72

Update: There is a workaround posted here Using Xcode 12.5 and iOS 14.5: The provided scheme is not valid. A scheme should not include special characters such as “:” or “/”. · Issue #189 · auth0/auth0-oidc-client-net (github.com)

1 Like

Thanks for sharing that with the rest of community!

I am facing the same error in react native, is there a known workaround for it?

Have you checked what @lhughey posted?