How to get a specific user's samlIdentity

Hi There,
I am trying to get a PR reviewer’s samlIdentity/Organization email using graphql. So far I can get the list of saml identities by using below query

query {
  organization(login: "org-slug-goes-here") {
    samlIdentityProvider {
      externalIdentities(first: 100) {
        edges {
          node {
            guid
            samlIdentity {
              nameId
            }
            user {
              login
            }
          }
        }
        pageInfo {
          endCursor
          hasNextPage
        }
      }
    }
  }
}

But what I want is actually getting a specific user’s SSO email, ideally by input the login as an argument. Any Idea how this can be done? Thanks

Hey there @hsy3418 :wave:

I poked around quite a bit, both in our GraphiQL explorer, and internally, to see if this can be done. Unfortunately, the externalIdentities object doesn’t allow us to define say, externalIdentities(login: "username") { as would solve for your use case.

Presumably, your Enterprise Org that you’re a part of is what you’re hoping to query against. Because of the Enterprise status, I’d recommend two actions.

  1. Submit your suggestion via our form, here. This is our general submission form that gets sent to our PM teams for review and consideration.
  2. Open a ticket directly with Enterprise Support and work with them to either, craft a custom solution to take the list of IDs, and then sort, and identify a specific user(s), but also to submit this suggestion internally on top of my first suggestion.

But as it is, our REST SCIM endpoint, and our list option in GraphQL are all that is available, without script-ifying a custom solution.

1 Like