Class BaseAuthorizationDecisionEndpoint
- java.lang.Object
-
- com.authlete.jaxrs.BaseEndpoint
-
- com.authlete.jaxrs.BaseAuthorizationDecisionEndpoint
-
public class BaseAuthorizationDecisionEndpoint extends BaseEndpoint
A base class for authorization decision endpoints.- Since:
- 1.2
- Author:
- Takahiko Kawasaki
-
-
Constructor Summary
Constructors Constructor Description BaseAuthorizationDecisionEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
handle(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi, AuthorizationDecisionHandler.Params params)
Handle an authorization decision request.javax.ws.rs.core.Response
handle(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi, String ticket, String[] claimNames, String[] claimLocales)
Handle an authorization decision request.-
Methods inherited from class com.authlete.jaxrs.BaseEndpoint
extractClientCertificate, extractClientCertificateChain, extractHeadersAsPairs, onError, takeAttribute
-
-
-
-
Method Detail
-
handle
public javax.ws.rs.core.Response handle(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi, String ticket, String[] claimNames, String[] claimLocales)
Handle an authorization decision request.This method internally creates a
AuthorizationDecisionHandler
instance and calls itsAuthorizationDecisionHandler.handle(String, String[], String[])
method. Then, this method uses the value returned from thehandle()
method as a response from this method.When
AuthorizationDecisionHandler.handle()
method raises aWebApplicationException
, this method callsonError()
method with the exception. The default implementation ofonError()
does nothing. You can override the method as necessary. After callingonError()
method, this method callsgetResponse()
method of the exception and uses the returned value as a response from this method.- Parameters:
api
- An implementation ofAuthleteApi
.spi
- An implementation ofAuthorizationDecisionHandlerSpi
.ticket
- A ticket that was issued by Authlete's/api/auth/authorization
API.claimNames
- Names of requested claims. Use the value of theclaims
parameter in a response from Authlete's/api/auth/authorization
API.claimLocales
- Requested claim locales. Use the value of theclaimsLocales
parameter in a response from Authlete's/api/auth/authorization
API.- Returns:
- A response that should be returned to the client application.
-
handle
public javax.ws.rs.core.Response handle(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi, AuthorizationDecisionHandler.Params params)
Handle an authorization decision request.This method internally creates a
AuthorizationDecisionHandler
instance and calls itsAuthorizationDecisionHandler.handle(String, String[], String[])
method. Then, this method uses the value returned from thehandle()
method as a response from this method.When
AuthorizationDecisionHandler.handle()
method raises aWebApplicationException
, this method callsonError()
method with the exception. The default implementation ofonError()
does nothing. You can override the method as necessary. After callingonError()
method, this method callsgetResponse()
method of the exception and uses the returned value as a response from this method.- Parameters:
api
- An implementation ofAuthleteApi
.spi
- An implementation ofAuthorizationDecisionHandlerSpi
.params
- Parameters necessary to handle the decision.- Returns:
- A response that should be returned to the client application.
- Since:
- 2.26
-
-