Interface IAuthorizationServerClient
- Assembly
- Keycloak.AuthServices.Authorization.dll
Keycloak AuthorizationServer API
public interface IAuthorizationServerClient
Methods
VerifyAccessToResource(string, string, ScopesValidationMode?, string?, CancellationToken)
Verifies access to the protected resource. Sends decision request to token endpoint {resource}#{scope}
Task<bool> VerifyAccessToResource(string resource, string scope, ScopesValidationMode? scopesValidationMode = null, string? audience = null, CancellationToken cancellationToken = default)
Parameters
resourcestringscopestringscopesValidationModeScopesValidationMode?audiencestringThe Keycloak client ID of the target resource server to use as the UMA
audienceparameter. Whennull, the globalKeycloakAuthorizationServerOptions.Resourcevalue is used.cancellationTokenCancellationToken
Returns
VerifyAccessToResource(string, string, string, ScopesValidationMode?, CancellationToken)
Verifies access to the protected resource using an explicit access token. Use this overload in SignalR or other long-lived connection scenarios where the token from HttpContext may be stale.
Task<bool> VerifyAccessToResource(string resource, string scope, string accessToken, ScopesValidationMode? scopesValidationMode = null, CancellationToken cancellationToken = default)
Parameters
resourcestringscopestringaccessTokenstringThe access token to use for the authorization request.
scopesValidationModeScopesValidationMode?cancellationTokenCancellationToken
Returns
VerifyAccessToResource(string, string, string, CancellationToken)
Verifies access to the protected resource using an explicit access token. Use this overload in SignalR or other long-lived connection scenarios where the token from HttpContext may be stale.
Task<bool> VerifyAccessToResource(string resource, string scope, string accessToken, CancellationToken cancellationToken = default)
Parameters
resourcestringscopestringaccessTokenstringThe access token to use for the authorization request.
cancellationTokenCancellationToken
Returns
VerifyAccessToResource(string, string, CancellationToken)
Verifies access to the protected resource. Sends decision request to token endpoint {resource}#{scope}
Task<bool> VerifyAccessToResource(string resource, string scope, CancellationToken cancellationToken = default)
Parameters
resourcestringscopestringcancellationTokenCancellationToken