Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created January 13, 2020 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhayes/13d1e028f6bb7567b936f79064dfe66c to your computer and use it in GitHub Desktop.
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
query {
organization(login: "org-goes-here") {
samlIdentityProvider {
ssoUrl
externalIdentities(first: 100) {
edges {
node {
guid
samlIdentity {
nameId
}
user {
login
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
@sbalagopal
Copy link

Hi, were you able to find a solution for mapping GitHub users to SSO email or ID?

@drhayes
Copy link
Author

drhayes commented Mar 31, 2022

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.

@sbalagopal
Copy link

Thank you, @drhayes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment