Forum Xamarin.Forms

How to logout using Azure ADAL ?

I am using Azure active directory authentication(ADAL library) in my Xamarin forms app.I want to have the logout functionality in my app.I cleared the token cache but somehow I am still getting a valid token and not the login page.Also if I have logged in with one user,I am unable to allow login for another user.As we are always getting the token associated with the first user.


  • @anandjitbanerjee.5636 did you figure out how to make an logout function?

  • anandjitbanerjee.5636anandjitbanerjee.5636 USUniversity ✭✭
    edited March 2017

    @MortenKruse.9726 You need to clear token and webview cookies for both the platforms on logout.Hope this helps.

  • bestofyasibestofyasi USMember

    @anandjitbanerjee.5636 Did you solve the problem? I'm also looking for answer this!

  • anandjitbanerjee.5636anandjitbanerjee.5636 USUniversity ✭✭

    @bestofyasi ..You need to clear webview cookies and cache also to make it happen.Let me know if you need the code snippet .I will try to find it out for you.

  • bestofyasibestofyasi USMember

    @anandjitbanerjee.5636 Can I've the code sample?

  • thanhtongthanhtong VNMember ✭✭
    edited September 2018

    @acrow59 Could you explain more detail what place will implement this solution in Xamarin.Forms please?
    First step is clearing your tokens:

    AuthenticationContext authContext = new AuthenticationContext("{Your_URI}");

Sign In or Register to comment.