Interface IKeycloakPolicyClient
- Namespace
- Keycloak.AuthServices.Sdk.Protection
- Assembly
- Keycloak.AuthServices.Sdk.dll
Must be used by the owner of the resource for whom the policy is being created.
public interface IKeycloakPolicyClient
Remarks
Methods
CreatePolicyAsync(string, string, Policy, CancellationToken)
Creates a policy
Task CreatePolicyAsync(string realm, string resourceId, Policy policy, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
resourceId
stringThe resource ID to create the policy for.
policy
PolicyPolicy representation
cancellationToken
CancellationToken
Returns
CreatePolicyWithResponseAsync(string, string, Policy, CancellationToken)
Creates a policy
Task<HttpResponseMessage> CreatePolicyWithResponseAsync(string realm, string resourceId, Policy policy, CancellationToken cancellationToken)
Parameters
realm
stringRealm name (not ID).
resourceId
stringThe resource ID to create the policy for.
policy
PolicyPolicy representation
cancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
The HttpResponseMessage of the request
DeletePolicyAsync(string, string, CancellationToken)
Deletes a policy
Task DeletePolicyAsync(string realm, string policyId, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID.
cancellationToken
CancellationToken
Returns
Remarks
DeletePolicyWithResponseAsync(string, string, CancellationToken)
Deletes a policy
Task<HttpResponseMessage> DeletePolicyWithResponseAsync(string realm, string policyId, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID.
cancellationToken
CancellationToken
Returns
Remarks
GetPoliciesAsync(string, GetPoliciesRequestParameters?, CancellationToken)
Gets all Policies
Task<IEnumerable<Policy>> GetPoliciesAsync(string realm, GetPoliciesRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
parameters
GetPoliciesRequestParameterscancellationToken
CancellationToken
Returns
- Task<IEnumerable<Policy>>
A list of policy representations Policy
Remarks
GetPoliciesWithResponseAsync(string, GetPoliciesRequestParameters?, CancellationToken)
Gets all Policies
Task<HttpResponseMessage> GetPoliciesWithResponseAsync(string realm, GetPoliciesRequestParameters? parameters = null, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
parameters
GetPoliciesRequestParameterscancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
The HttpResponseMessage of the request
Remarks
GetPolicyAsync(string, string, CancellationToken)
Get representation of a Policy
Task<Policy> GetPolicyAsync(string realm, string policyId, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID
cancellationToken
CancellationToken
Returns
GetPolicyWithResponseAsync(string, string, CancellationToken)
Gets a Policy
Task<HttpResponseMessage> GetPolicyWithResponseAsync(string realm, string policyId, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID
cancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
The HttpResponseMessage of the request
UpdatePolicyAsync(string, string, Policy, CancellationToken)
Updates a policy
Task UpdatePolicyAsync(string realm, string policyId, Policy policy, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID.
policy
PolicyPolicy object.
cancellationToken
CancellationToken
Returns
Remarks
UpdatePolicyWithResponseAsync(string, string, Policy, CancellationToken)
Updates a policy
Task<HttpResponseMessage> UpdatePolicyWithResponseAsync(string realm, string policyId, Policy policy, CancellationToken cancellationToken = default)
Parameters
realm
stringRealm name (not ID).
policyId
stringPolicy ID.
policy
PolicyPolicy object.
cancellationToken
CancellationToken