Forum Xamarin Xamarin.Forms

With Azure Active Directory & App Services, Allow multiple users to log in/out.

I am using the Azure Active Directory + App Services to allow a user to authenticate in a mobile Xamarin.Android app. I am using this walkthrough as a guide -

Multiple users will use the same device, so I am going through the Xamarin/Azure documentation to simple research this scenario. Given the sample code:

    // Define a authenticated user.
    private MobileServiceUser user;
    //Mobile Service Client reference
    private MobileServiceClient client;

I call

client.LoginAsync(this, MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory);

and am able to log in a user through the AAD oAuth process as shown in the guide - allowing them to enter their credentials. However, using client.LogoutAsync() only temporarily logs out the current user in the app. If I call client.LoginAsync() w/params again, it simply flashes the oAuth dialog for a second and logs the original user again. How can I force the client/AAD to allow a different user to log in?


  • HeathcliffHeathcliff UYMember ✭✭

    Hi @Willindigo , did you find the answer to this? I need the same solution. I will appreciate it if you give me some tips to do this. Thanks!

  • WillindigoWillindigo USMember

    Sorry this is late, but apparently you have to clear the cache in Android Webkit framework used by Xamarin. I dropped the app so I never was able to get it working in iOS, but found some code that worked like a charm for Xamarin.Android and Xamarin.Forms. Take a look here - - Xamarin Log Out with Android H/T @Rahul Patil

Sign In or Register to comment.