Interface IKeycloakGroupClient
- Namespace
- Keycloak.AuthServices.Sdk.Admin
- Assembly
- Keycloak.AuthServices.Sdk.dll
Group management
public interface IKeycloakGroupClient
Methods
CreateChildGroupAsync(string, string, GroupRepresentation, CancellationToken)
Set or create child.
Task CreateChildGroupAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken
Returns
Remarks
This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist.
CreateChildGroupWithResponseAsync(string, string, GroupRepresentation, CancellationToken)
Set or create child.
Task<HttpResponseMessage> CreateChildGroupWithResponseAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken
Returns
Remarks
This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist.
CreateGroupAsync(string, GroupRepresentation, CancellationToken)
Create or add a top level realm groupSet or create child.
Task CreateGroupAsync(string realm, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken
Returns
Remarks
This will update the group and set the parent if it exists. Create it and set the parent if the group doesn’t exist.
CreateGroupWithResponseAsync(string, GroupRepresentation, CancellationToken)
Create or add a top level realm groupSet or create child.
Task<HttpResponseMessage> CreateGroupWithResponseAsync(string realm, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken
Returns
Remarks
This will update the group and set the parent if it exists. Create it and set the parent if the group doesn’t exist.
DeleteGroupAsync(string, string, CancellationToken)
Delete a group. Note: the Keycloak documentation does not specify if this deletes subgroups.
Task DeleteGroupAsync(string realm, string groupId, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
cancellationTokenCancellationToken
Returns
DeleteGroupWithResponseAsync(string, string, CancellationToken)
Delete a group. Note: the Keycloak documentation does not specify if this deletes subgroups.
Task<HttpResponseMessage> DeleteGroupWithResponseAsync(string realm, string groupId, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
cancellationTokenCancellationToken
Returns
GetGroupAsync(string, string, CancellationToken)
Get representation of a Group.
Task<GroupRepresentation> GetGroupAsync(string realm, string groupId, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
cancellationTokenCancellationToken
Returns
- Task<GroupRepresentation>
The group representation.
GetGroupWithResponseAsync(string, string, CancellationToken)
Get representation of a Group.
Task<HttpResponseMessage> GetGroupWithResponseAsync(string realm, string groupId, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
cancellationTokenCancellationToken
Returns
- Task<HttpResponseMessage>
The group representation.
GetGroupsAsync(string, GetGroupsRequestParameters?, CancellationToken)
Get group hierarchy. Only name and ids are returned.
Task<IEnumerable<GroupRepresentation>> GetGroupsAsync(string realm, GetGroupsRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
parametersGetGroupsRequestParametersOptional query parameters.
cancellationTokenCancellationToken
Returns
- Task<IEnumerable<GroupRepresentation>>
A stream of groups, filtered according to query parameters.
GetGroupsWithResponseAsync(string, GetGroupsRequestParameters?, CancellationToken)
Get a collection of groups on the realm.
Task<HttpResponseMessage> GetGroupsWithResponseAsync(string realm, GetGroupsRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
parametersGetGroupsRequestParametersOptional query parameters.
cancellationTokenCancellationToken
Returns
- Task<HttpResponseMessage>
A stream of groups, filtered according to query parameters.
GetSubGroupsAsync(string, string, GetGroupsRequestParameters?, CancellationToken)
Get group hierarchy. Only name and ids are returned.
Task<IEnumerable<GroupRepresentation>> GetSubGroupsAsync(string realm, string parentGroupId, GetGroupsRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
parentGroupIdstringparametersGetGroupsRequestParametersOptional query parameters.
cancellationTokenCancellationToken
Returns
- Task<IEnumerable<GroupRepresentation>>
A stream of groups, filtered according to query parameters.
GetSubGroupsWithResponseAsync(string, string, GetGroupsRequestParameters?, CancellationToken)
Get a collection of sub groups by parent's id on the realm.
Task<HttpResponseMessage> GetSubGroupsWithResponseAsync(string realm, string parentGroupId, GetGroupsRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
parentGroupIdstringParent Group ID.
parametersGetGroupsRequestParametersOptional query parameters.
cancellationTokenCancellationToken
Returns
UpdateGroupAsync(string, string, GroupRepresentation, CancellationToken)
Update group, ignores subgroups.
Task UpdateGroupAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken
Returns
UpdateGroupWithResponseAsync(string, string, GroupRepresentation, CancellationToken)
Update group, ignores subgroups.
Task<HttpResponseMessage> UpdateGroupWithResponseAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realmstringRealm name (not ID).
groupIdstringGroup ID.
groupGroupRepresentationGroup representation.
cancellationTokenCancellationToken