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
realm
stringRealm name (not ID).
groupId
stringGroup ID.
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
groupId
stringGroup ID.
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
groupId
stringGroup ID.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
groupId
stringGroup ID.
cancellationToken
CancellationToken
Returns
GetGroupAsync(string, string, CancellationToken)
Get representation of a Group.
Task<GroupRepresentation> GetGroupAsync(string realm, string groupId, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
groupId
stringGroup ID.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
groupId
stringGroup ID.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
parameters
GetGroupsRequestParametersOptional query parameters.
cancellationToken
CancellationToken
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
realm
stringRealm name (not ID).
parameters
GetGroupsRequestParametersOptional query parameters.
cancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
A stream of groups, filtered according to query parameters.
UpdateGroupAsync(string, string, GroupRepresentation, CancellationToken)
Update group, ignores subgroups.
Task UpdateGroupAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
groupId
stringGroup ID.
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken
Returns
UpdateGroupWithResponseAsync(string, string, GroupRepresentation, CancellationToken)
Update group, ignores subgroups.
Task<HttpResponseMessage> UpdateGroupWithResponseAsync(string realm, string groupId, GroupRepresentation group, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
groupId
stringGroup ID.
group
GroupRepresentationGroup representation.
cancellationToken
CancellationToken