Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SCIM and SAML identities for all members in an Organization
{
"data": {
"resource": {
"samlIdentityProvider": {
"externalIdentities": {
"nodes": [
{
"scimIdentity": {
"username": "user1"
},
"samlIdentity": {
"nameId": "user1@example.com"
},
"user": {
"login": "user1",
"email": ""
}
},
{
"scimIdentity": {
"username": "user2"
},
"samlIdentity": {
"nameId": "user2@example.com"
},
"user": {
"login": "user2",
"email": "user2@example.com"
}
},
{
"scimIdentity": {
"username": null
},
"samlIdentity": {
"nameId": "user3@example.com"
},
"user": {
"login": "user3",
"email": "user3@example.com"
}
},
{
"scimIdentity": {
"username": null
},
"samlIdentity": {
"nameId": "user4@user4.com"
},
"user": {
"login": "user4",
"email": "user4@example.com"
}
},
{
"scimIdentity": {
"username": null
},
"samlIdentity": {
"nameId": "user5@example.com"
},
"user": {
"login": "user5",
"email": "user5@example.com"
}
},
{
"scimIdentity": {
"username": null
},
"samlIdentity": {
"nameId": "user6@example.com"
},
"user": {
"login": "user6",
"email": ""
}
},
{
"scimIdentity": {
"username": "user7"
},
"samlIdentity": {
"nameId": "user7@example.com"
},
"user": {
"login": "user7",
"email": ""
}
},
{
"scimIdentity": {
"username": "user8"
},
"samlIdentity": {
"nameId": "user8@example.com"
},
"user": {
"login": "user8",
"email": ""
}
},
{
"scimIdentity": {
"username": null
},
"samlIdentity": {
"nameId": "user9@example.com"
},
"user": {
"login": "webdog",
"email": "user9@example.com"
}
},
{
"scimIdentity": {
"username": "user10"
},
"samlIdentity": {
"nameId": "user10@example.com"
},
"user": {
"login": "user10",
"email": "user10@example.com"
}
}
]
}
}
}
}
}
# Pass the URL for an Organization into the query
# to get a list of members in a specific Organization.
# Example: { "url": "https://github.com/:organization" }
query getResource($url: URI!) {
resource(url: $url) {
... on Organization {
samlIdentityProvider {
externalIdentities(first:10) {
nodes {
scimIdentity {
username
}
samlIdentity {
nameId
}
user {
login
email
}
}
}
}
}
}
}
@jonico

This comment has been minimized.

Copy link

@jonico jonico commented Mar 14, 2019

this example needs admin:org, user:email and user:read scope + the OAuth/PAT has to be authorized for use in the SAML protected organization

@justanothernate

This comment has been minimized.

Copy link

@justanothernate justanothernate commented Nov 15, 2019

Also if you need pagination, you'll want something like below:

query getResource($url: URI!) {
  resource(url: $url) {
    ... on Organization {
      samlIdentityProvider {
        externalIdentities(first:100, after:"xxxxxxxxx") {
            nodes {
              scimIdentity {
                username
              }
              samlIdentity {
                nameId
              }
              user {
                login
                email
              }
            }
          edges{
            node {
              user {
                login
              }
            }
          }
          pageInfo {
            endCursor
            hasNextPage
          }
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment