8000 Create enterprise-saml-identities-filtered-by-nameid.graphql · github/platform-samples@c927d55 · GitHub
[go: up one dir, main page]

Skip to content

Commit c927d55

Browse files
authored
Create enterprise-saml-identities-filtered-by-nameid.graphql
1 parent 5402450 commit c927d55

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# You will need to replace <Enterprise Slug> and <SAML Name ID> with the actual GitHub enterprise slug and the SAML `NameID` value that you're searching stored external identities for in the GitHub enterprise.
2+
# For GitHub Enterprise Cloud enterprises that have SAML configured at the enterprise level, this will query the stored SAML `nameId` external identity values in the GitHub enterprise, and if one is found that matches the value specified for `<SAML Name ID>`, it will print out the SAML `nameId` and GitHub username for that stored external identity.
3+
4+
# This query will not print out a user username (`login`) value if there is not a GitHub user account linked to this SAML identity.
5+
# Pagination shouldn't be needed since there shouldn't be multiple entries in the enterprise that have the same SAML `NameID` or SCIM `userName`. However, for more information on pagination. There is also an example of pagination in simple-pagination-example.graphql.
6+
7+
8+
query EnterpriseIdentitiesBySAMLNameID {
9+
enterprise(slug:"<Enterprise Slug>") {
10+
name
11+
members(query:"<SAML Name ID>", first:25) {
12+
totalCount
13+
pageInfo {
14+
hasNextPage
15+
startCursor
16+
endCursor
17+
}
18+
nodes{
19+
...on EnterpriseUserAccount {
20+
id
21+
login
22+
createdAt
23+
}
24+
}
25+
}
26+
ownerInfo {
27+
samlIdentityProvider {
28+
externalIdentities(userName:"<SAML Name ID>", first: 25) {
29+
totalCount
30+
pageInfo {
31+
hasNextPage
32+
startCursor
33+
endCursor
34+
}
35+
nodes{
36+
samlIdentity {
37+
nameId
38+
}
39+
user {
40+
login
41+
}
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)
0