# Find all users who used "login with facebook"

**URL:** https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313
**Category:** Data & reporting
**Tags:** oauth2, sql-query
**Created:** [30 בדצמבר,‏ 2018,‏ 1:42pm UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313 "2018-12-30T13:42:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![darix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darix/32/114280_2.png) [@darix](https://meta.discourse.org/u/darix)
#### Post date: [30 בדצמבר,‏ 2018,‏ 1:42pm UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/1 "2018-12-30T13:42:08Z")

</div>

for reasons we want to discontinue that and would like to know the impact it would have on our user base. is there an easy way to find that out?

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [30 בדצמבר,‏ 2018,‏ 2:10pm UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/2 "2018-12-30T14:10:04Z")

</div>

There’s some discussion about this here

> [@How do I see Facebook signups?](https://meta.discourse.org/t/how-do-i-see-facebook-signups/91989/):
>
> Hi, is there any way to see who of my new forum sign-ups have used the Facebook login/sign-up plugin? Many thanks, Torsten

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [31 בדצמבר,‏ 2018,‏ 12:23am UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/3 "2018-12-31T00:23:45Z")

</div>

@david once your work consolidating is done, can you add a quick built-in report to [data explorer](https://meta.discourse.org/t/32566?silent=true) that counts users per auth method. I think it can help make decisions in some cases.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [31 בדצמבר,‏ 2018,‏ 12:25am UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/4 "2018-12-31T00:25:04Z")

</div>

Definitely 👍. Once the new stuff is done we will also be able to report on “last used date”, which should be useful for deciding which methods are important.

---

<div class="post-metadata">

### Author: ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)
#### Post date: [23 ביוני,‏ 2020,‏ 8:45am UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/9 "2020-06-23T08:45:38Z")

</div>

## These [Data Explorer](https://meta.discourse.org/t/32566?silent=true) queries can help in these cases.

* * *

#### 1ª List of users per login with Facebook

```
WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    user_id,
    info->>'name' name_user,
    info->>'email' email_user,
    info->>'image' image_user
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
    AND provider_name = 'facebook'

```

| provider\_name | user\_id | name | email | image |
| --- | --- | --- | --- | --- |
| facebook | 1 | User1 | [user1@gmail.com](mailto:user1@gmail.com) | [https://graph.facebook.com/.../photo1.jpg](https://graph.facebook.com/.../photo1.jpg) |
| facebook | 2 | User2 | [user2@yahoo.com](mailto:user2@yahoo.com) | [https://graph.facebook.com/.../photo2.jpg](https://graph.facebook.com/.../photo2.jpg) |

* * *

* * *

#### 2ª List of users per external login method

- discord
- facebook
- github
- google\_oauth2
- twitter

* * *

```
WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    user_id,
    info->>'name' AS name,
    info->>'email' AS email,
    info->>'image' AS image
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)

```

| provider\_name | user\_id | name | email | image |
| --- | --- | --- | --- | --- |
| google\_oauth2 | 1 | User1 | [user1@gmail.com](mailto:user1@gmail.com) | [https://lh3.googleusercontent.com/.../p1.jpg](https://lh3.googleusercontent.com/.../p1.jpg) |
| facebook | 2 | User2 | [user2@yahoo.com](mailto:user2@yahoo.com) | [https://graph.facebook.com/.../p2.jpg](https://graph.facebook.com/.../p2.jpg) |
| twitter | 3 | User3 | [user3@gmail.com](mailto:user3@gmail.com) | [http://pbs.twimg.com/profile\_img/.../p1.jpg](http://pbs.twimg.com/profile_img/.../p1.jpg) |

* * *

* * *

#### 3ª Number of users per external login method

```
WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    COUNT(user_id) AS qtd
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
GROUP BY provider_name
UNION
SELECT 
    'github', 
    COUNT(user_id)
FROM github_user_infos
WHERE user_id IN (SELECT id FROM target_user_ids)
ORDER BY provider_name

```

| provider\_name | qtd |
| --- | --- |
| discord | 10 |
| facebook | 100 |
| github | 400 |
| google\_oauth2 | 500 |
| twitter | 200 |

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [8 באוגוסט,‏ 2025,‏ 9:37pm UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/12 "2025-08-08T21:37:31Z")

</div>

תודה על פרסום השאילתות האלה! 2ª בדיוק ענה על שאלה שהייתה לי.

(הגברת מילות מפתח: רשימת משתמשי oauth, מציאת משתמשי oauth)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [4 במרץ,‏ 2026,‏ 5:40pm UTC](https://meta.discourse.org/t/find-all-users-who-used-login-with-facebook/105313/13 "2026-03-04T17:40:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
