Class AuthorizationResource
java.lang.Object
org.keycloak.authorization.client.resource.AuthorizationResource
An entry point for obtaining permissions from the server.
- Author:
- Pedro Igor
-
Constructor Summary
ConstructorDescriptionAuthorizationResource
(Configuration configuration, ServerConfiguration serverConfiguration, Http http, TokenCallable token) -
Method Summary
Modifier and TypeMethodDescriptionQuery the server for all permissions.authorize
(AuthorizationRequest request) Query the server for permissions given anAuthorizationRequest
.getPermissions
(AuthorizationRequest request) Query the server for a list of permissions given anAuthorizationRequest
.
-
Constructor Details
-
AuthorizationResource
public AuthorizationResource(Configuration configuration, ServerConfiguration serverConfiguration, Http http, TokenCallable token)
-
-
Method Details
-
authorize
Query the server for all permissions.- Returns:
- an
AuthorizationResponse
with a RPT holding all granted permissions - Throws:
AuthorizationDeniedException
- in case the request was denied by the server
-
authorize
public AuthorizationResponse authorize(AuthorizationRequest request) throws AuthorizationDeniedException Query the server for permissions given anAuthorizationRequest
.- Parameters:
request
- anAuthorizationRequest
(notnull
)- Returns:
- an
AuthorizationResponse
with a RPT holding all granted permissions - Throws:
AuthorizationDeniedException
- in case the request was denied by the server
-
getPermissions
public List<Permission> getPermissions(AuthorizationRequest request) throws AuthorizationDeniedException Query the server for a list of permissions given anAuthorizationRequest
.- Parameters:
request
- anAuthorizationRequest
(notnull
)- Returns:
- a list of permissions granted by the server
- Throws:
AuthorizationDeniedException
- in case the request was denied by the server
-