The OpenUrl or CustomUrlSchemeInterceptorActivity is being called
The AuthenticationState.Authenticator.OnPageLoading(uri) is called
The event called Authenticator_Error(object sender, AuthenticatorErrorEventArgs e) is called with the following Exception.
'"utf-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name@
Platform:
[] .NET Standard version = 2.0
[] Visual Studio version = 17 (15.7.5)
[] Xamarin version = 4.10.10.2
[] Xamarin Adnroid version = 8.3.3.2
[] Xamarin iOS version = 11.12.0.4
Expected behaviour
After a success authentication process with Facebook, call the Complete event with the flag IsAuthenticated true and close the browser to display the Mobile App.
Actual behaviour
The error event is being call after a success authentication with Facebook including one Exception that says:
Exception Message:
'"utf-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name@
The StackTrace:
at System.Globalization.EncodingTable.internalGetCodePageFromName (System.String name) [0x00082] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/EncodingTable.cs:799
at System.Globalization.EncodingTable.GetCodePageFromName (System.String name) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/EncodingTable.cs:862
at System.Text.Encoding.GetEncoding (System.String name) [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/text/encoding.cs:696
at System.Net.Http.HttpContent+d20.MoveNext () [0x000d5] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs:182
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Xamarin.Auth.OAuth2Authenticator+d45.MoveNext () [0x00108] in <5426a6dbbfb9439a9005b7bf164bb3d1>:0
Response Uri
fb98*66449**://authorize/?code=AQAqY6X9JIb9S0G_*****DPVW9Hm0k7W1jXdudcqg0G0GFLN54nq6leS8rak8Z-n_n-23LB04t8gYg0GFqNktvrXefSyEGgrpOaeGDL**_lOY-vYY0Yyts_mZJPQ**gAwQ0mptS0kz1djF-v2lMWby3vq249BNHRUtEBxD*****qEuu9bFJKgyGpXZpZTkebxJ9iuAeuTOAqt--9Wgl-QaI1dPqb3B**zT5ZyqiVcMFa2DaK9rc&state=obsi****tlm#=_
NOTE
I changed several character to use *(asterisk) instead to hide the sensitive data.
Works with
The same version works perfectly with Google Oauth configuration.
I hope this can be enough information to fix this issue or give a guidance to solve it.
Xamarin.Auth Issue
Version
Steps to reproduce
'"utf-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. Parameter name: name@
Platform:
Expected behaviour
After a success authentication process with Facebook, call the Complete event with the flag IsAuthenticated true and close the browser to display the Mobile App.
Actual behaviour
The error event is being call after a success authentication with Facebook including one Exception that says:
Exception Message:
'"utf-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. Parameter name: name@
The StackTrace:
at System.Globalization.EncodingTable.internalGetCodePageFromName (System.String name) [0x00082] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/EncodingTable.cs:799 at System.Globalization.EncodingTable.GetCodePageFromName (System.String name) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/EncodingTable.cs:862 at System.Text.Encoding.GetEncoding (System.String name) [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/text/encoding.cs:696 at System.Net.Http.HttpContent+d20.MoveNext () [0x000d5] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs:182
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Xamarin.Auth.OAuth2Authenticator+d 45.MoveNext () [0x00108] in <5426a6dbbfb9439a9005b7bf164bb3d1>:0
Facebook Configuration
"ClientId": "98*66449" "ClientSecret": "8a459**18c16bab732****" "Scope": "email" "AuthorizeUrl": "https://www.facebook.com/dialog/oauth/", "RedirectUrl": "fb98*66449****://authorize", "AccessTokenUrl": "https://m.facebook.com/dialog/oauth/token" "IsUsingNativeUI": true
Response Uri fb98*66449**://authorize/?code=AQAqY6X9JIb9S0G_*****DPVW9Hm0k7W1jXdudcqg0G0GFLN54nq6leS8rak8Z-n_n-23LB04t8gYg0GFqNktvrXefSyEGgrpOaeGDL**_lOY-vYY0Yyts_mZJPQ**gAwQ0mptS0kz1djF-v2lMWby3vq249BNHRUtEBxD*****qEuu9bFJKgyGpXZpZTkebxJ9iuAeuTOAqt--9Wgl-QaI1dPqb3B**zT5ZyqiVcMFa2DaK9rc&state=obsi****tlm#=_
NOTE
I changed several character to use *(asterisk) instead to hide the sensitive data.
Works with
I hope this can be enough information to fix this issue or give a guidance to solve it.