Last active
April 30, 2021 16:42
-
-
Save tcbyrd/da7065646f676ba2c55a467ed9a68e00 to your computer and use it in GitHub Desktop.
SCIM and SAML identities for all members in an Organization
This file contains hidden or 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
{ | |
"data": { | |
"resource": { | |
"samlIdentityProvider": { | |
"externalIdentities": { | |
"nodes": [ | |
{ | |
"scimIdentity": { | |
"username": "user1" | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user1", | |
"email": "" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": "user2" | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user2", | |
"email": "[email protected]" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": null | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user3", | |
"email": "[email protected]" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": null | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user4", | |
"email": "[email protected]" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": null | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user5", | |
"email": "[email protected]" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": null | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user6", | |
"email": "" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": "user7" | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user7", | |
"email": "" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": "user8" | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user8", | |
"email": "" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": null | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "webdog", | |
"email": "[email protected]" | |
} | |
}, | |
{ | |
"scimIdentity": { | |
"username": "user10" | |
}, | |
"samlIdentity": { | |
"nameId": "[email protected]" | |
}, | |
"user": { | |
"login": "user10", | |
"email": "[email protected]" | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} |
This file contains hidden or 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
# 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 | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
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
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