# Logout v2 not working for social logins

**URL:** <https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376>\
**Category:** Get Help\
**Tags:** social, not-working, v2, logout\
**Created:** [October 3, 2017, 6:13pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376 "2017-10-03T18:13:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![accounts6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/accounts6/32/10353_2.png) [@accounts6](https://community.auth0.com/u/accounts6)\
**Post date:** [October 3, 2017, 6:13pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/1 "2017-10-03T18:13:20Z")

</div>

I have developed one chrome extension and using Auth0 Chrome extension SDK to integrate it and it works all well. When it comes to logout, I am redirecting user to URL as mentioned in [How Logout Works on Auth0 - Auth0 Docs](https://auth0.com/docs/logout#log-out-a-user)  
But user is not asked for email and password for social login when user clicks on login again.

Any idea how this can be fixed?

* * *

**Update**

Here is the code used for the logout call:

```
var logoutUser = function (cb) {
    console.log('Make API Call logoutUser: ', requestData);

    var xhr = $.ajax('https:// ****** /v2/logout?federated', {
        async: true,
        crossDomain: true,
        method: 'GET',
        error: function (xhr, status, err) {
            console.log('AJAX Error', xhr.status, xhr.responseText);
            if (xhr.status === 429) {
                return cb({
                    status: 429,
                    message: xhr.responseJSON.message
                })
            } else {
                return cb({
                    status: 400,
                    message: 'Ajax Error'
                });
            }
        },
        success: function (res) {
            return cb(null, res);
        }
    })
}

```

---

<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:** [October 4, 2017, 7:42pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/2 "2017-10-04T19:42:01Z")

</div>

You should update your question with additional information, in particular, the chrome extension source code associated with how you implemented logout. There’s a lot of things that can impact the ability to logout, for example, a social provider may even not allow to perform this sort of programmatic logout or you may be calling logout in a place that is different of the one where the session was established so it ends up not having the desired effect.

---

<div class="post-metadata">

**Author:** ![accounts6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/accounts6/32/10353_2.png) [@accounts6](https://community.auth0.com/u/accounts6)\
**Post date:** [October 4, 2017, 7:58pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/3 "2017-10-04T19:58:04Z")

</div>

@jmangelo I am using Auth0Chrome SDK. Here is the link of example code - [https://auth0.com/docs/quickstart/native/chrome/01-login](https://auth0.com/docs/quickstart/native/chrome/01-login)  
In logout I am clearing localStorage where I am keeping the tokens and calling  
https:///v2/logout?federated in background.js when user click on logout button  
Let me know if you need more details

---

<div class="post-metadata">

**Author:** ![accounts6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/accounts6/32/10353_2.png) [@accounts6](https://community.auth0.com/u/accounts6)\
**Post date:** [October 4, 2017, 7:58pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/4 "2017-10-04T19:58:04Z")

</div>

@jmangelo I am using Auth0Chrome SDK. Here is the link of example code - [https://auth0.com/docs/quickstart/native/chrome/01-login](https://auth0.com/docs/quickstart/native/chrome/01-login)  
In logout I am clearing localStorage where I am keeping the tokens and calling  
https:///v2/logout?federated in background.js when user click on logout button  
Let me know if you need more details

---

<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:** [October 4, 2017, 8:01pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/5 "2017-10-04T20:01:59Z")

</div>

@accounts6 yeah, I checked the quickstart and the logout showed there is only local so can you include as a question update how do you exactly call the logout endpoint in _background.js_? I confess that I’m not that knowledgeable in Chrome extensions so the more specific you can be the better for me.

---

<div class="post-metadata">

**Author:** ![accounts6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/accounts6/32/10353_2.png) [@accounts6](https://community.auth0.com/u/accounts6)\
**Post date:** [October 4, 2017, 8:08pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/6 "2017-10-04T20:08:38Z")

</div>

@jmangelo It is simple HTTP call to the above endpoint; I updated the quesion.

---

<div class="post-metadata">

**Author:** ![accounts6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/accounts6/32/10353_2.png) [@accounts6](https://community.auth0.com/u/accounts6)\
**Post date:** [October 4, 2017, 8:08pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/7 "2017-10-04T20:08:38Z")

</div>

@jmangelo It is simple HTTP call to the above endpoint; I updated the quesion.

---

<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:** [October 4, 2017, 10:29pm UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/8 "2017-10-04T22:29:03Z")

</div>

Based on my (limited) knowledge around chrome extension, the way you are performing the call means that the logout is executed in a scope that is not associated with the initial login so it won’t perform any actual logout as there’s no existing session to logout from when you call it like a regular AJAX call.

The logout needs to be performed in the same scope that the login; from a quick look at how login works and also based on this SO [question/answer](https://stackoverflow.com/questions/26080632/how-do-i-log-out-of-a-chrome-identity-oauth-provider) you may need to use `chrome.identity.launchWebAuthFlow` to perform the logout. The same method is used for login so this would ensure that the logout clear the authenticated session where that session was indeed created.

---

<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:56am UTC](https://community.auth0.com/t/logout-v2-not-working-for-social-logins/8376/9 "2018-03-02T05:56:48Z")

</div>


