auth0 / auth0-aspnet-owin

Auth0 ASP.NET 4.5 Owin/Katana Authentication Handler
MIT License
46 stars 50 forks source link

Federated logout not supported #47

Closed MoppDepp closed 7 years ago

MoppDepp commented 7 years ago

How one should implement federated logout in v2.0? https://github.com/auth0/auth0-aspnet-owin/blob/master/src/Auth0.Owin/Auth0AuthenticationHandler.cs#L224

jerriep commented 7 years ago

@MoppDepp I'll look into adding this

jerriep commented 7 years ago

I see you opened a Zendesk issue as well

Let's close this and rather carry on on Zendesk

jerriep commented 7 years ago

Support added in 2.1.0 (https://www.nuget.org/packages/Auth0-ASPNET-Owin)

Add .federated dictionary key with value of true to AuthenticationProperties when logging out:

public void Logout()
{
    HttpContext.GetOwinContext().Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType);
    HttpContext.GetOwinContext()
        .Authentication.SignOut(new AuthenticationProperties(
            new Dictionary<string, string>
            {
                {".federated", "true"}
            })
        {
            RedirectUri = Url.Action("Index", "Home"),
        }, "Auth0");
}