# Redirected to Facebook after logout (Owin, wsfederation)

**URL:** <https://community.auth0.com/t/redirected-to-facebook-after-logout-owin-wsfederation/8957>\
**Category:** Get Help\
**Tags:** mvc, facebook, aspnet, logout, owin\
**Created:** [December 12, 2017, 8:18pm UTC](https://community.auth0.com/t/redirected-to-facebook-after-logout-owin-wsfederation/8957 "2017-12-12T20:18:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas.westling](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@andreas.westling](https://community.auth0.com/u/andreas.westling)\
**Post date:** [December 12, 2017, 8:18pm UTC](https://community.auth0.com/t/redirected-to-facebook-after-logout-owin-wsfederation/8957/1 "2017-12-12T20:18:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 28, 2017, 6:26pm UTC](https://community.auth0.com/t/redirected-to-facebook-after-logout-owin-wsfederation/8957/2 "2017-12-28T18:26:27Z")

</div>

When it comes to logout request that are mean to reach downstream identity providers like Facebook the actual requirements may vary by provider. For example, in the case of Facebook the logout request must be accompanied by the end-user access token; this is detailed in this section of the [reference documentation](https://auth0.com/docs/logout#facebook-users).

From the information provided it is not clear if you’re meeting that requirement or not so that could be one possible explanation. In addition, even if the access token is correctly passed Facebook might not honor the logout request or the final redirect to your client application is not performed if the Facebook application you registered is not configured properly.

For example, you may have issues if you don’t add a platform for the application (web site) and don’t list your client application domain in the settings; check the top-voted answer on this SO [question](https://stackoverflow.com/questions/22331373/facebook-js-api-cant-logout) on the same topic.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/redirected-to-facebook-after-logout-owin-wsfederation/8957/3 "2018-03-02T05:57:45Z")

</div>


