I’m using Owin middleware to configure ws-federated authentication for my MVC application. I’ve enabled Facebook as a social connection.
Everything works when logging in using Facebook, but when loggin out I’m always redirected to Facebook after logout completes instead of back to my application.
I’ve added my application url to the allowed logout urls in the Auth0 settings, as well as in the facebook app.
When logging the user out I use the following code:
HttpContext.GetOwinContext().Authentication.SignOut(new AuthenticationProperties
{
RedirectUri = "http://mysite.dev/"
}, WsFederationAuthenticationDefaults.AuthenticationType);
In the Auth0 log there’s the following entry:
{
"date": "2017-12-12T10:58:32.527Z",
"type": "slo",
"description": "Redirected to IdP",
"connection": "facebook",
"connection_id": "con_vdvCpY81iFKe2K9Y",
"client_id": "XXXXX",
"client_name": "MyClient",
"ip": "127.10.100.100",
"user_agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
"details": {
"return_to": "http://mysite.dev/",
"allowed_logout_url":
"http://mysite.dev/",
"http:/mysite.dev"
]
},
"user_id": "facebook|12345678910",
"user_name": "me@gmail.com",
"log_id": "49570627966157796616778729595816630758012413822423057458"
}
As you can see the return_to url and allowed logout url are both set.
What else do I need to do to get redirected back to my app after logout?