You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a .Net 7 for iOS project during a standard browser login flow, after logging in successfully in the browser, an exception is thrown from the Auth0 LoginAsync method. This only happens on iOS, and doesn't happen on Android with the same Core library version (3.4.1).
Versions of SDKs:
OidcClient.Core: 3.4.1
OidcClient.AndroidX: 3.5.0
OidcClient.iOS: 3.6.0
Full stack trace below:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'. ---> Microsoft.IdentityModel.Json.JsonSerializationException: Error setting value in extension data for type 'Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration'. Path 'device_authorization_endpoint', line 1, position 264. ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Collections.Generic.IDictionary2<string, object> :invoke_callvirt_IDictionary`2<string, object>_OpenIdConnectConfiguration (Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Linq.Expressions.Interpreter.FuncCallInstruction2[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[System.Collections.Generic.IDictionary2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
at System.Dynamic.Utils.DelegateHelpers.FuncThunk1[Object,Object](Func2 handler, Object t1) at Microsoft.IdentityModel.Json.Serialization.DefaultContractResolver.<>c__DisplayClass44_1.<SetExtensionDataDelegates>b__0(Object o, String key, Object value) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Microsoft.IdentityModel.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.IdentityModel.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject[OpenIdConnectConfiguration](String value, JsonSerializerSettings settings) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject[OpenIdConnectConfiguration](String value) at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel) at Microsoft.IdentityModel.Protocols.ConfigurationManager1.d__26[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.<GetConfigurationAsync>d__26[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext() at Microsoft.IdentityModel.Protocols.ConfigurationManager1.d__25[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()
at Auth0.OidcClient.Tokens.JsonWebKeys.GetForIssuer(String issuer)
at Auth0.OidcClient.Tokens.AsymmetricSignatureVerifier.ForJwks(String issuer)
at Auth0.OidcClient.Tokens.IdTokenValidator.AssertTokenMeetsRequirements(IdTokenRequirements required, String rawIDToken, Nullable1 pointInTime, ISignatureVerifier signatureVerifier) at Auth0.OidcClient.Auth0ClientBase.LoginAsync(Object extraParameters, CancellationToken cancellationToken)
WORKAROUND
We did find a workaround by forcing the transitive dependency of Microsoft.IdentityModel.Protocols.OpenIdConnect to the latest version (7.0.3 as of this post). This fixed the exception and allowed us to log in fine on iOS.
Reproduction
Create a .Net 7 for iOS project (this likely would happen with a MAUI project as well, but haven't validated that)
Setup the Auth0Client as normal in the iOS project, setting a Domain, ClientId, and Scope.
Utilize the IAuth0Client interface from the created Auth0Client to call the LoginAsync() method, passing in any relevant parameters and a cancellation Token.
Login to your Auth0 tenant inside the browser shown by the Auth0 SDK. Should look like: var loginResult = await _auth0Client.LoginAsync(extraParameters, cancellationToken);
Either wrap that call in a try/catch to see the exception, or it'll crash the app if it's not in a try/catch, in which you'll be able to see the exception provided in the description.
Additional context
No response
auth0-oidc-client-net version
3.4.1
.NET version
7
Platform
iOS
Platform version(s)
3.6.0
The text was updated successfully, but these errors were encountered:
System.InvalidOperationException
Message=IDX20803: Unable to obtain configuration from: 'System.String'.
0xFFFFFFFFFFFFFFFF in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception C#
0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:13,5 C#
0x1D in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:27,26 C#
0x17 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw C#
0x6 in System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0 C#
0xC in Android.App.SyncContext. at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:36,19 C#
0xE in Java.Lang.Thread.RunnableImplementor.Run at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36,6 C#
0x8 in Java.Lang.IRunnableInvoker.n_Run at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Java.Lang.IRunnable.cs:84,4 C#
0x8 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:26,5 C#
Checklist
Description
In a .Net 7 for iOS project during a standard browser login flow, after logging in successfully in the browser, an exception is thrown from the Auth0 LoginAsync method. This only happens on iOS, and doesn't happen on Android with the same Core library version (3.4.1).
Versions of SDKs:
OidcClient.Core: 3.4.1
OidcClient.AndroidX: 3.5.0
OidcClient.iOS: 3.6.0
Full stack trace below:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'. ---> Microsoft.IdentityModel.Json.JsonSerializationException: Error setting value in extension data for type 'Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration'. Path 'device_authorization_endpoint', line 1, position 264. ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Collections.Generic.IDictionary
2<string, object> :invoke_callvirt_IDictionary`2<string, object>_OpenIdConnectConfiguration (Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.at System.Linq.Expressions.Interpreter.FuncCallInstruction
2[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[System.Collections.Generic.IDictionary
2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
at System.Dynamic.Utils.DelegateHelpers.FuncThunk1[Object,Object](Func
2 handler, Object t1) at Microsoft.IdentityModel.Json.Serialization.DefaultContractResolver.<>c__DisplayClass44_1.<SetExtensionDataDelegates>b__0(Object o, String key, Object value) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Microsoft.IdentityModel.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Microsoft.IdentityModel.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.IdentityModel.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject[OpenIdConnectConfiguration](String value, JsonSerializerSettings settings) at Microsoft.IdentityModel.Json.JsonConvert.DeserializeObject[OpenIdConnectConfiguration](String value) at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel) at Microsoft.IdentityModel.Protocols.ConfigurationManager
1.d__26[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager
1.<GetConfigurationAsync>d__26[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext() at Microsoft.IdentityModel.Protocols.ConfigurationManager
1.d__25[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()at Auth0.OidcClient.Tokens.JsonWebKeys.GetForIssuer(String issuer)
at Auth0.OidcClient.Tokens.AsymmetricSignatureVerifier.ForJwks(String issuer)
at Auth0.OidcClient.Tokens.IdTokenValidator.AssertTokenMeetsRequirements(IdTokenRequirements required, String rawIDToken, Nullable
1 pointInTime, ISignatureVerifier signatureVerifier) at Auth0.OidcClient.Auth0ClientBase.LoginAsync(Object extraParameters, CancellationToken cancellationToken)
WORKAROUND
We did find a workaround by forcing the transitive dependency of Microsoft.IdentityModel.Protocols.OpenIdConnect to the latest version (7.0.3 as of this post). This fixed the exception and allowed us to log in fine on iOS.
Reproduction
var loginResult = await _auth0Client.LoginAsync(extraParameters, cancellationToken);
Additional context
No response
auth0-oidc-client-net version
3.4.1
.NET version
7
Platform
iOS
Platform version(s)
3.6.0
The text was updated successfully, but these errors were encountered: