8000 Update GraphQL query for SAML identities · github/platform-samples@d4a7f81 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4a7f81

Browse files
authored
Update GraphQL query for SAML identities
1 parent 08b0ad9 commit d4a7f81

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

graphql/queries/enterprise-saml-identities-filtered-by-nameid.graphql

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,33 @@
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.
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.
22
# 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.
33

4+
# Note that the query below will not tell you if the GitHub username/account associated with this linked identity is still a member of the enterprise. Enterprise owners can navigate to the Enterprise > People > Members UI and search for the user to determine this, or perform a different GraphQL query using the https://docs.github.com/en/enterprise-cloud@latest/graphql/reference/objects#enterprise object with the members(query:"<SAML Name ID>") filter.
5+
46
# This query will not print out a user username (`login`) value if there is not a GitHub user account linked to this SAML identity.
57
# 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.
68

79

810
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-
}
11+
enterprise(slug: "<ENTERPRISE_SLUG>") {
2612
ownerInfo {
2713
samlIdentityProvider {
2814
externalIdentities(userName:"<SAML Name ID>", first: 25) {
2915
totalCount
16+
edges {
17+
node {
18+
guid
19+
samlIdentity {
20+
nameId
21+
}
22+
user {
23+
login
24+
}
25+
}
26+
}
3027
pageInfo {
3128
hasNextPage
32-
startCursor
3329
endCursor
3430
}
35-
nodes{
36-
samlIdentity {
37-
nameId
38-
}
39-
user {
40-
login
41-
}
42-
}
4331
}
4432
}
4533
}

0 commit comments

Comments
 (0)
0