Class AuthorizationResource
- java.lang.Object
-
- org.keycloak.authorization.client.resource.AuthorizationResource
-
public class AuthorizationResource extends Object
An entry point for obtaining permissions from the server.- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description AuthorizationResource(Configuration configuration, ServerConfiguration serverConfiguration, Http http, TokenCallable token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationResponse
authorize()
Query the server for all permissions.AuthorizationResponse
authorize(AuthorizationRequest request)
Query the server for permissions given anAuthorizationRequest
.List<Permission>
getPermissions(AuthorizationRequest request)
Query the server for a list of permissions given anAuthorizationRequest
.
-
-
-
Constructor Detail
-
AuthorizationResource
public AuthorizationResource(Configuration configuration, ServerConfiguration serverConfiguration, Http http, TokenCallable token)
-
-
Method Detail
-
authorize
public AuthorizationResponse authorize() throws AuthorizationDeniedException
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
-
-