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
{{ message }}
This repository was archived by the owner on May 15, 2024. It is now read-only.
When using Web Authenticator (in my case incorporating IdentityModel.OidcClient and using PKCE) then on iOS when the iOS permission to use the authority for sign in appears and you decline, an NSErrorException is thrown "Domain=com.apple.AuthenticationServices.WebAuthenticationSession Code=1" in WebAuthenticator.ios.tvos.cs at line 115
Ensure you are using flow as OidcClientOptions.AuthenticationFlow.AuthorizationCode (PKCE) and that the authority you are using is using shared cookies.
Attempt to logon but decline the iOS permission to sign in using the authority.
Expected Behavior
WebAuthenticator fails gracefully. For example it returns a null response or an error response.
Actual Behavior
NSErrorException is thrown with the following stacktrace:
at Xamarin.Essentials.WebAuthenticator.PlatformAuthenticateAsync (System.Uri url, System.Uri callbackUrl) [0x003fc] in d:\a\1\s\Xamarin.Essentials\WebAuthenticator\WebAuthenticator.ios.tvos.cs:115
at TestIdentity.Browser.InvokeAsync (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x00034] in D:\DocComs\TestApps\ExampleDocComsOauth\TestIdentity\TestIdentity\Browser.cs:15
at IdentityModel.OidcClient.AuthorizeClient.AuthorizeAsync (IdentityModel.OidcClient.AuthorizeRequest request, System.Threading.CancellationToken cancellationToken) [0x000e7] 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 TestIdentity.IdentityViewModel.Login () [0x0004d] in D:\DocComs\TestApps\ExampleDocComsOauth\TestIdentity\TestIdentity\IdentityViewModel.cs:46
Description
When using Web Authenticator (in my case incorporating IdentityModel.OidcClient and using PKCE) then on iOS when the iOS permission to use the authority for sign in appears and you decline, an NSErrorException is thrown "Domain=com.apple.AuthenticationServices.WebAuthenticationSession Code=1" in WebAuthenticator.ios.tvos.cs at line 115
Steps to Reproduce
Expected Behavior
WebAuthenticator fails gracefully. For example it returns a null response or an error response.
Actual Behavior
NSErrorException is thrown with the following stacktrace:
at Xamarin.Essentials.WebAuthenticator.PlatformAuthenticateAsync (System.Uri url, System.Uri callbackUrl) [0x003fc] in d:\a\1\s\Xamarin.Essentials\WebAuthenticator\WebAuthenticator.ios.tvos.cs:115
at TestIdentity.Browser.InvokeAsync (IdentityModel.OidcClient.Browser.BrowserOptions options, System.Threading.CancellationToken cancellationToken) [0x00034] in D:\DocComs\TestApps\ExampleDocComsOauth\TestIdentity\TestIdentity\Browser.cs:15
at IdentityModel.OidcClient.AuthorizeClient.AuthorizeAsync (IdentityModel.OidcClient.AuthorizeRequest request, System.Threading.CancellationToken cancellationToken) [0x000e7] 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 TestIdentity.IdentityViewModel.Login () [0x0004d] in D:\DocComs\TestApps\ExampleDocComsOauth\TestIdentity\TestIdentity\IdentityViewModel.cs:46
Basic Information
Xamarin.Forms V4.5.0.617
Xamarin.Essentials V1.5.3.1
Visual Studio 2019 Prof V16.5.4
iOS 13.4