Find all users who used "login with facebook"

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?

There’s some discussion about this here

@david once your work consolidating is done, can you add a quick built-in report to data explorer that counts users per auth method. I think it can help make decisions in some cases.

Definitely :+1:. 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.

이러한 경우를 위해 다음 Data Explorer 쿼리가 도움이 될 수 있습니다.


1. 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 https://graph.facebook.com/.../photo1.jpg
facebook 2 User2 user2@yahoo.com https://graph.facebook.com/.../photo2.jpg


2. 외부 로그인 방식별 사용자 목록

  • 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)


3. 외부 로그인 방식별 사용자 수

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

이 쿼리들을 올려주셔서 감사합니다! 2번은 제가 궁금했던 질문에 대한 답이 되었습니다.

(키워드 부스트: oauth 사용자 목록, oauth 사용자 찾기, oauth 사용자 리포트)