Skip to content

Instantly share code, notes, and snippets.

@cocojoe
Last active September 26, 2019 18:06
Show Gist options
  • Save cocojoe/8a3c61dd7bc44a3f737b40c937755785 to your computer and use it in GitHub Desktop.
Save cocojoe/8a3c61dd7bc44a3f737b40c937755785 to your computer and use it in GitHub Desktop.
Xamarin ASWebAuthenticationSession iOS 13
// Source https://github.com/auth0/auth0-oidc-client-net/blob/master/src/Auth0.OidcClient.iOS/ASWebAuthenticationSessionBrowser.cs#L22-L32
ASWebAuthenticationSession asWebAuthenticationSession = null;
asWebAuthenticationSession = new ASWebAuthenticationSession(
new NSUrl(options.StartUrl),
options.EndUrl,
(callbackUrl, error) =>
{
tcs.SetResult(CreateBrowserResult(callbackUrl, error));
asWebAuthenticationSession.Dispose();
});
#if __IOS__13
asWebAuthenticationSession.PresentationContextProvider = UIApplication.SharedApplication.KeyWindow
#endif
asWebAuthenticationSession.Start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment