Table of Contents

Interface IKeycloakProtectedResourceClient

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 IKeycloakProtectedResourceClient

Methods

CreateResourceAsync(string, Resource, CancellationToken)

Creates resource

Task<ResourceResponse> CreateResourceAsync(string realm, Resource resource, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resource Resource
cancellationToken CancellationToken

Returns

Task<ResourceResponse>

CreateResourceWithResponseAsync(string, Resource, CancellationToken)

Creates resource

Task<HttpResponseMessage> CreateResourceWithResponseAsync(string realm, Resource resource, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resource Resource
cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

DeleteResourceAsync(string, string, CancellationToken)

Deletes a resource

Task DeleteResourceAsync(string realm, string resourceId, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

cancellationToken CancellationToken

Returns

Task

DeleteResourceWithResponseAsync(string, string, CancellationToken)

Deletes a resource

Task<HttpResponseMessage> DeleteResourceWithResponseAsync(string realm, string resourceId, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

GetResourceAsync(string, string, CancellationToken)

Gets resource by Id

Task<ResourceResponse> GetResourceAsync(string realm, string resourceId, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

cancellationToken CancellationToken

Returns

Task<ResourceResponse>

GetResourceWithResponseAsync(string, string, CancellationToken)

Gets resource by Id

Task<HttpResponseMessage> GetResourceWithResponseAsync(string realm, string resourceId, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

GetResourcesAsync(string, GetResourcesRequestParameters?, CancellationToken)

Searches for resources

Task<IList<ResourceResponse>> GetResourcesAsync(string realm, GetResourcesRequestParameters? parameters = null, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

parameters GetResourcesRequestParameters

Optional query parameters

cancellationToken CancellationToken

Returns

Task<IList<ResourceResponse>>

GetResourcesIdsAsync(string, GetResourcesRequestParameters?, CancellationToken)

Searches for resource

Task<IList<string>> GetResourcesIdsAsync(string realm, GetResourcesRequestParameters? parameters = null, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

parameters GetResourcesRequestParameters

Optional query parameters

cancellationToken CancellationToken

Returns

Task<IList<string>>

GetResourcesIdsWithResponseAsync(string, GetResourcesRequestParameters?, CancellationToken)

Searches for resource

Task<HttpResponseMessage> GetResourcesIdsWithResponseAsync(string realm, GetResourcesRequestParameters? parameters = null, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

parameters GetResourcesRequestParameters

Optional query parameters

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

GetResourcesWithResponseAsync(string, GetResourcesRequestParameters?, CancellationToken)

Searches for resources

Task<HttpResponseMessage> GetResourcesWithResponseAsync(string realm, GetResourcesRequestParameters? parameters = null, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

parameters GetResourcesRequestParameters

Optional query parameters

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

UpdateResourceAsync(string, string, Resource, CancellationToken)

Updates resource

Task UpdateResourceAsync(string realm, string resourceId, Resource resource, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

resource Resource
cancellationToken CancellationToken

Returns

Task

Remarks

UpdateResourceWithResponseAsync(string, string, Resource, CancellationToken)

Updates resource

Task<HttpResponseMessage> UpdateResourceWithResponseAsync(string realm, string resourceId, Resource resource, CancellationToken cancellationToken = default)

Parameters

realm string

Realm name (not ID).

resourceId string

Resource ID.

resource Resource
cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

Remarks