public class OAuth2CrestAuthorizationModule extends Object implements CrestAuthorizationModule
An implementation of a CrestAuthorizationModule which uses a OAuth2 Access Token from the
Authorization header from the request.
| Modifier and Type | Method and Description |
|---|---|
Promise<AuthorizationResult,ResourceException> |
authorizeAction(Context context,
ActionRequest request)
Authorizes a received REST action request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizeCreate(Context context,
CreateRequest request)
Authorizes a received REST create request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizeDelete(Context context,
DeleteRequest request)
Authorizes a received REST delete request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizePatch(Context context,
PatchRequest request)
Authorizes a received REST patch request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizeQuery(Context context,
QueryRequest request)
Authorizes a received REST query request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizeRead(Context context,
ReadRequest request)
Authorizes a received REST read request using the OAuth2 Access Token present in the request header.
|
Promise<AuthorizationResult,ResourceException> |
authorizeUpdate(Context context,
UpdateRequest request)
Authorizes a received REST update request using the OAuth2 Access Token present in the request header.
|
String |
getName()
Returns the name of the authorization module.
|
public String getName()
CrestAuthorizationModulegetName in interface CrestAuthorizationModulepublic Promise<AuthorizationResult,ResourceException> authorizeCreate(Context context, CreateRequest request)
Authorizes a received REST create request using the OAuth2 Access Token present in the request header.
authorizeCreate in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The CreateRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizeRead(Context context, ReadRequest request)
Authorizes a received REST read request using the OAuth2 Access Token present in the request header.
authorizeRead in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The ReadRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizeUpdate(Context context, UpdateRequest request)
Authorizes a received REST update request using the OAuth2 Access Token present in the request header.
authorizeUpdate in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The UpdateRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizeDelete(Context context, DeleteRequest request)
Authorizes a received REST delete request using the OAuth2 Access Token present in the request header.
authorizeDelete in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The DeleteRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizePatch(Context context, PatchRequest request)
Authorizes a received REST patch request using the OAuth2 Access Token present in the request header.
authorizePatch in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The PatchRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizeAction(Context context, ActionRequest request)
Authorizes a received REST action request using the OAuth2 Access Token present in the request header.
authorizeAction in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The ActionRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.public Promise<AuthorizationResult,ResourceException> authorizeQuery(Context context, QueryRequest request)
Authorizes a received REST query request using the OAuth2 Access Token present in the request header.
authorizeQuery in interface CrestAuthorizationModulecontext - The Context representing the context of the request.request - The QueryRequest to authorize.Promise representing the result of the method call. The result of the Promise, when the
method completes successfully, will be an AuthorizationResult containing the result of the authorization,
or will be an ResourceException detailing the cause of the failure.Copyright © 2025 Open Identity Platform Community. All rights reserved.