Forum General

Can I close the Login browser/window stays open in Android & iOS Xamarin.Forms?

blmilesblmiles Member ✭✭


The login mechanics work well in Xamarin Forms for both iOS and Android using auth0, however, the login window that opens in default browser remains open after successful login.

How do I force the login screen to close after successful login?
Specifically for Xamarin.Forms in both iOS and Android

This is my code snippet that instantiates and launches the login screen(s):

    var auth0Client = new Auth0Client(new Auth0ClientOptions
        Domain = "",
        ClientId = "abc-123-xyz",
        Scope = "openid profile email" //"openid profile email"                

    var loginResult = await **auth0Client.LoginAsync(); **//launches login screen (default browser) and user logs in. **Need to close browser if possible**
    RetrieveUserDetails(loginResult); //after login
    return loginResult.IdentityToken;

Any help, suggestions would be great.

Thank you

Sign In or Register to comment.