Created
January 13, 2020 16:51
-
-
Save drhayes/13d1e028f6bb7567b936f79064dfe66c to your computer and use it in GitHub Desktop.
GraphQL query for v4 GitHub API to find every user in an organization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
organization(login: "org-goes-here") { | |
samlIdentityProvider { | |
ssoUrl | |
externalIdentities(first: 100) { | |
edges { | |
node { | |
guid | |
samlIdentity { | |
nameId | |
} | |
user { | |
login | |
} | |
} | |
} | |
pageInfo { | |
endCursor | |
hasNextPage | |
} | |
} | |
} | |
} | |
} |
Yeah, this query works, you just need admin:org
scope to run it. You can then page through the results, looking in the nameId
and login
fields.
Thank you, @drhayes!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, were you able to find a solution for mapping GitHub users to SSO email or ID?