Last active
September 26, 2019 18:06
-
-
Save cocojoe/8a3c61dd7bc44a3f737b40c937755785 to your computer and use it in GitHub Desktop.
Xamarin ASWebAuthenticationSession iOS 13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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