GraphQL to update SSO Key/Value mappings for the Group
search cancel

GraphQL to update SSO Key/Value mappings for the Group

book

Article ID: 440833

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

If a user wants to update the SSO Key/Value mappings for multiple user groups, GraphQL can be used.

Resolution

1. GraphQL query to get the User Group

query UserGroupList {
  userGroups(first: 10) {
    nodes {
      id, name, description,identityAttributeRules {
      key
      values
    
    }
    }
  }
}

 

2.  To update the User Group

Query
--------------------------------------------
mutation UpdateUserGroup($input: UpdateUserGroupInput!) {
  updateUserGroup(input: $input) {
    userGroup {
      id
      __typename
    }
    __typename
  }
}

---------------------------------------------
Variable
---------------------------------------------
{
  "input": {
    "id": "crn:45267:user-group/3161095931163",
    "name": "Administrators",
    "description": "Administrators",
    "identityAttributeRules": [
      {
        "key": "groups",
        "values": [
          "cloudhealth-administratorrrrr"
        ]
      }
      ,
      {
        "key": "department", 
        "values": [
          "Engineering"
        ]
      }
    ]
  }
}