Package com.authlete.jaxrs
Class AuthorizationDecisionHandler
- java.lang.Object
-
- com.authlete.jaxrs.AuthorizationDecisionHandler
-
public class AuthorizationDecisionHandler extends Object
Handler for end-user's decision on the authorization request.An authorization endpoint returns an authorization page (HTML) to an end-user, and the end-user will select either "authorize" or "deny" the authorization request. This class handles the decision and calls Authlete's
/api/auth/authorization/issue
API or/api/auth/authorization/fail
API accordingly.- Author:
- Takahiko Kawasaki
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizationDecisionHandler.Params
Parameters for this handler.
-
Constructor Summary
Constructors Constructor Description AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi)
Constructor with an implementation ofAuthleteApi
interface and an implementation ofAuthorizationDecisionHandlerSpi
interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.authlete.jaxrs.AuthleteApiCaller
getApiCaller()
javax.ws.rs.core.Response
handle(AuthorizationDecisionHandler.Params params)
Handle an end-user's decision on an authorization request.javax.ws.rs.core.Response
handle(String ticket, String[] claimNames, String[] claimLocales)
Handle an end-user's decision on an authorization request.protected javax.ws.rs.InternalServerErrorException
unexpected(String message, Throwable cause)
-
-
-
Constructor Detail
-
AuthorizationDecisionHandler
public AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi)
Constructor with an implementation ofAuthleteApi
interface and an implementation ofAuthorizationDecisionHandlerSpi
interface.- Parameters:
api
- Implementation ofAuthleteApi
interface.spi
- Implementation ofAuthorizationDecisionHandlerSpi
interface.
-
-
Method Detail
-
handle
public javax.ws.rs.core.Response handle(String ticket, String[] claimNames, String[] claimLocales) throws javax.ws.rs.WebApplicationException
Handle an end-user's decision on an authorization request.- Parameters:
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 to the client application. Basically, the response will trigger redirection to the client's redirection endpoint.
- Throws:
javax.ws.rs.WebApplicationException
- An error occurred.
-
handle
public javax.ws.rs.core.Response handle(AuthorizationDecisionHandler.Params params) throws javax.ws.rs.WebApplicationException
Handle an end-user's decision on an authorization request.- Parameters:
params
- Parameters necessary to handle the decision.- Returns:
- A response to the client application. Basically, the response will trigger redirection to the client's redirection endpoint.
- Throws:
javax.ws.rs.WebApplicationException
- An error occurred.- Since:
- 2.25
-
getApiCaller
protected com.authlete.jaxrs.AuthleteApiCaller getApiCaller()
-
-