API version:
Show / Hide Table of Contents

Class GroupsClient

Provides methods that manipulate Group resources, by communicating with the Okta Groups API.

Inheritance
System.Object
OktaClient
GroupsClient
Implements
IOktaClient
IGroupsClient
System.Collections.Generic.IAsyncEnumerable<IGroup>
Inherited Members
OktaClient.Configuration
OktaClient.CreateScoped(RequestContext)
OktaClient.UserTypes
OktaClient.Users
OktaClient.UserFactors
OktaClient.Groups
OktaClient.Applications
OktaClient.Sessions
OktaClient.AuthorizationServers
OktaClient.Logs
OktaClient.Policies
OktaClient.EventHooks
OktaClient.InlineHooks
OktaClient.LinkedObjects
OktaClient.TrustedOrigins
OktaClient.Features
OktaClient.Templates
OktaClient.NetworkZones
OktaClient.Domains
OktaClient.IdentityProviders
OktaClient.UserSchemas
OktaClient.GetCollectionClient<T>(HttpRequest)
OktaClient.GetAsync<T>(String, CancellationToken)
OktaClient.GetAsync<T>(HttpRequest, CancellationToken)
OktaClient.GetCollection<T>(String)
OktaClient.GetCollection<T>(HttpRequest)
OktaClient.PostAsync(String, Object, CancellationToken)
OktaClient.PostAsync<TResponse>(String, Object, CancellationToken)
OktaClient.PostAsync(HttpRequest, CancellationToken)
OktaClient.PostAsync<TResponse>(HttpRequest, CancellationToken)
OktaClient.PutAsync(String, Object, CancellationToken)
OktaClient.PutAsync<TResponse>(String, Object, CancellationToken)
OktaClient.PutAsync(HttpRequest, CancellationToken)
OktaClient.PutAsync<TResponse>(HttpRequest, CancellationToken)
OktaClient.DeleteAsync(String, CancellationToken)
OktaClient.DeleteAsync(HttpRequest, CancellationToken)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public sealed class GroupsClient : OktaClient, IOktaClient, IGroupsClient, IAsyncEnumerable<IGroup>

Methods

ActivateGroupRuleAsync(String, CancellationToken)

Activates a specific group rule by id from your organization

Declaration
public Task ActivateGroupRuleAsync(string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String ruleId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

AddApplicationInstanceTargetToAppAdminRoleGivenToGroupAsync(String, String, String, String, CancellationToken)

Add App Instance Target to App Administrator Role given to a Group

Declaration
public Task AddApplicationInstanceTargetToAppAdminRoleGivenToGroupAsync(string groupId, string roleId, string appName, string applicationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String appName
System.String applicationId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

AddApplicationTargetToAdminRoleGivenToGroupAsync(String, String, String, CancellationToken)

Success

Declaration
public Task AddApplicationTargetToAdminRoleGivenToGroupAsync(string groupId, string roleId, string appName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String appName
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

AddGroupTargetToGroupAdministratorRoleForGroupAsync(String, String, String, CancellationToken)

Declaration
public Task AddGroupTargetToGroupAdministratorRoleForGroupAsync(string groupId, string roleId, string targetGroupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String targetGroupId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

AddUserToGroupAsync(String, String, CancellationToken)

Adds a user to a group with 'OKTA_GROUP' type.

Declaration
public Task AddUserToGroupAsync(string groupId, string userId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String userId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

AssignRoleToGroupAsync(IAssignRoleRequest, String, String, CancellationToken)

Assigns a Role to a Group

Declaration
public Task<IRole> AssignRoleToGroupAsync(IAssignRoleRequest assignRoleRequest, string groupId, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IAssignRoleRequest assignRoleRequest

The IAssignRoleRequest resource.

System.String groupId
System.String disableNotifications
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IRole>

The IRole response.

CreateGroupAsync(CreateGroupOptions, CancellationToken)

Adds a new group with OKTA_GROUP type to your organization.

Declaration
public Task<IGroup> CreateGroupAsync(CreateGroupOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
CreateGroupOptions options

The options for this Create Group request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroup>

The IGroup response.

CreateGroupAsync(IGroup, CancellationToken)

Adds a new group with OKTA_GROUP type to your organization.

Declaration
public Task<IGroup> CreateGroupAsync(IGroup group, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IGroup group

The IGroup resource.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroup>

The IGroup response.

CreateGroupRuleAsync(IGroupRule, CancellationToken)

Creates a group rule to dynamically add users to the specified group if they match the condition

Declaration
public Task<IGroupRule> CreateGroupRuleAsync(IGroupRule groupRule, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IGroupRule groupRule

The IGroupRule resource.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroupRule>

The IGroupRule response.

DeactivateGroupRuleAsync(String, CancellationToken)

Deactivates a specific group rule by id from your organization

Declaration
public Task DeactivateGroupRuleAsync(string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String ruleId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

DeleteGroupAsync(String, CancellationToken)

Removes a group with OKTA_GROUP type from your organization.

Declaration
public Task DeleteGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

DeleteGroupRuleAsync(String, Nullable<Boolean>, CancellationToken)

Removes a specific group rule by id from your organization

Declaration
public Task DeleteGroupRuleAsync(string ruleId, bool? removeUsers = default(bool? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String ruleId
System.Nullable<System.Boolean> removeUsers

Indicates whether to keep or remove users from groups assigned by this rule.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

GetAsyncEnumerator(CancellationToken)

Declaration
public IAsyncEnumerator<IGroup> GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Collections.Generic.IAsyncEnumerator<IGroup>

GetGroupAsync(String, CancellationToken)

Fetches a group from your organization.

Declaration
public Task<IGroup> GetGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroup>

The IGroup response.

GetGroupRuleAsync(String, String, CancellationToken)

Fetches a specific group rule by id from your organization

Declaration
public Task<IGroupRule> GetGroupRuleAsync(string ruleId, string expand = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String ruleId
System.String expand
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroupRule>

The IGroupRule response.

GetRoleAsync(String, String, CancellationToken)

Success

Declaration
public Task<IRole> GetRoleAsync(string groupId, string roleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IRole>

The IRole response.

ListApplicationTargetsForApplicationAdministratorRoleForGroup(String, String, String, Nullable<Int32>)

Lists all App targets for an APP_ADMIN Role assigned to a Group. This methods return list may include full Applications or Instances. The response for an instance will have an ID value, while Application will not have an ID.

Declaration
public ICollectionClient<ICatalogApplication> ListApplicationTargetsForApplicationAdministratorRoleForGroup(string groupId, string roleId, string after = null, int? limit)
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String after
System.Nullable<System.Int32> limit
Returns
Type Description
ICollectionClient<ICatalogApplication>

A collection of ICatalogApplication that can be enumerated asynchronously.

ListAssignedApplicationsForGroup(String, String, Nullable<Int32>)

Enumerates all applications that are assigned to a group.

Declaration
public ICollectionClient<IApplication> ListAssignedApplicationsForGroup(string groupId, string after = null, int? limit)
Parameters
Type Name Description
System.String groupId
System.String after

Specifies the pagination cursor for the next page of apps

System.Nullable<System.Int32> limit

Specifies the number of app results for a page

Returns
Type Description
ICollectionClient<IApplication>

A collection of IApplication that can be enumerated asynchronously.

ListGroupAssignedRoles(String, String)

Success

Declaration
public ICollectionClient<IRole> ListGroupAssignedRoles(string groupId, string expand = null)
Parameters
Type Name Description
System.String groupId
System.String expand
Returns
Type Description
ICollectionClient<IRole>

A collection of IRole that can be enumerated asynchronously.

ListGroupRules(Nullable<Int32>, String, String, String)

Lists all group rules for your organization.

Declaration
public ICollectionClient<IGroupRule> ListGroupRules(int? limit, string after = null, string search = null, string expand = null)
Parameters
Type Name Description
System.Nullable<System.Int32> limit

Specifies the number of rule results in a page

System.String after

Specifies the pagination cursor for the next page of rules

System.String search

Specifies the keyword to search fules for

System.String expand

If specified as groupIdToGroupNameMap, then show group names

Returns
Type Description
ICollectionClient<IGroupRule>

A collection of IGroupRule that can be enumerated asynchronously.

ListGroups(String, String, String, Nullable<Int32>, String)

Enumerates groups in your organization with pagination. A subset of groups can be returned that match a supported filter expression or query.

Declaration
public ICollectionClient<IGroup> ListGroups(string q = null, string search = null, string after = null, int? limit, string expand = null)
Parameters
Type Name Description
System.String q

Searches the name property of groups for matching value

System.String search

Filter expression for groups

System.String after

Specifies the pagination cursor for the next page of groups

System.Nullable<System.Int32> limit

Specifies the number of group results in a page

System.String expand

If specified, it causes additional metadata to be included in the response.

Returns
Type Description
ICollectionClient<IGroup>

A collection of IGroup that can be enumerated asynchronously.

ListGroupTargetsForGroupRole(String, String, String, Nullable<Int32>)

Success

Declaration
public ICollectionClient<IGroup> ListGroupTargetsForGroupRole(string groupId, string roleId, string after = null, int? limit)
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String after
System.Nullable<System.Int32> limit
Returns
Type Description
ICollectionClient<IGroup>

A collection of IGroup that can be enumerated asynchronously.

ListGroupUsers(String, String, Nullable<Int32>)

Enumerates all users that are a member of a group.

Declaration
public ICollectionClient<IUser> ListGroupUsers(string groupId, string after = null, int? limit)
Parameters
Type Name Description
System.String groupId
System.String after

Specifies the pagination cursor for the next page of users

System.Nullable<System.Int32> limit

Specifies the number of user results in a page

Returns
Type Description
ICollectionClient<IUser>

A collection of IUser that can be enumerated asynchronously.

RemoveApplicationTargetFromAdministratorRoleGivenToGroupAsync(String, String, String, String, CancellationToken)

Remove App Instance Target to App Administrator Role given to a Group

Declaration
public Task RemoveApplicationTargetFromAdministratorRoleGivenToGroupAsync(string groupId, string roleId, string appName, string applicationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String appName
System.String applicationId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

RemoveApplicationTargetFromApplicationAdministratorRoleGivenToGroupAsync(String, String, String, CancellationToken)

Success

Declaration
public Task RemoveApplicationTargetFromApplicationAdministratorRoleGivenToGroupAsync(string groupId, string roleId, string appName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String appName
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

RemoveGroupTargetFromGroupAdministratorRoleGivenToGroupAsync(String, String, String, CancellationToken)

Declaration
public Task RemoveGroupTargetFromGroupAdministratorRoleGivenToGroupAsync(string groupId, string roleId, string targetGroupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.String targetGroupId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

RemoveRoleFromGroupAsync(String, String, CancellationToken)

Unassigns a Role from a Group

Declaration
public Task RemoveRoleFromGroupAsync(string groupId, string roleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String roleId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

RemoveUserFromGroupAsync(String, String, CancellationToken)

Removes a user from a group with 'OKTA_GROUP' type.

Declaration
public Task RemoveUserFromGroupAsync(string groupId, string userId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String groupId
System.String userId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task that represents the asynchronous operation.

UpdateGroupAsync(IGroup, String, CancellationToken)

Updates the profile for a group with OKTA_GROUP type from your organization.

Declaration
public Task<IGroup> UpdateGroupAsync(IGroup group, string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IGroup group

The IGroup resource.

System.String groupId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroup>

The IGroup response.

UpdateGroupRuleAsync(IGroupRule, String, CancellationToken)

Updates a group rule. Only INACTIVE rules can be updated.

Declaration
public Task<IGroupRule> UpdateGroupRuleAsync(IGroupRule groupRule, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IGroupRule groupRule

The IGroupRule resource.

System.String ruleId
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IGroupRule>

The IGroupRule response.

Implements

IOktaClient
IGroupsClient
System.Collections.Generic.IAsyncEnumerable<T>
Back to top Copyright © 2021 Okta, Inc.
Generated with DocFx.