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/issueAPI or/api/auth/authorization/failAPI accordingly.- Author:
- Takahiko Kawasaki
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthorizationDecisionHandler.ParamsParameters for this handler.
-
Constructor Summary
Constructors Constructor Description AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi)Constructor with an implementation ofAuthleteApiinterface and an implementation ofAuthorizationDecisionHandlerSpiinterface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.authlete.jaxrs.AuthleteApiCallergetApiCaller()javax.ws.rs.core.Responsehandle(AuthorizationDecisionHandler.Params params, com.authlete.common.api.Options authzIssueOptions, com.authlete.common.api.Options authzFailOptions)Handle an end-user's decision on an authorization request.javax.ws.rs.core.Responsehandle(String ticket, String[] claimNames, String[] claimLocales)Handle an end-user's decision on an authorization request.javax.ws.rs.core.Responsehandle(String ticket, String[] claimNames, String[] claimLocales, com.authlete.common.api.Options authzIssueOptions, com.authlete.common.api.Options authzFailOptions)Handle an end-user's decision on an authorization request.protected javax.ws.rs.InternalServerErrorExceptionunexpected(String message, Throwable cause)
-
-
-
Constructor Detail
-
AuthorizationDecisionHandler
public AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi)Constructor with an implementation ofAuthleteApiinterface and an implementation ofAuthorizationDecisionHandlerSpiinterface.- Parameters:
api- Implementation ofAuthleteApiinterface.spi- Implementation ofAuthorizationDecisionHandlerSpiinterface.
-
-
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. This method is an alias ofhandle(ticket, claimNames, claimLocales, null, null).- Parameters:
ticket- A ticket that was issued by Authlete's/api/auth/authorizationAPI.claimNames- Names of requested claims. Use the value of theclaimsparameter in a response from Authlete's/api/auth/authorizationAPI.claimLocales- Requested claim locales. Use the value of theclaimsLocalesparameter in a response from Authlete's/api/auth/authorizationAPI.- 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(String ticket, String[] claimNames, String[] claimLocales, com.authlete.common.api.Options authzIssueOptions, com.authlete.common.api.Options authzFailOptions) throws javax.ws.rs.WebApplicationException
Handle an end-user's decision on an authorization request. This method is an alias of thehandle(Params, Options, Options)method.- Parameters:
ticket- A ticket that was issued by Authlete's/api/auth/authorizationAPI.claimNames- Names of requested claims. Use the value of theclaimsparameter in a response from Authlete's/api/auth/authorizationAPI.claimLocales- Requested claim locales. Use the value of theclaimsLocalesparameter in a response from Authlete's/api/auth/authorizationAPI.authzIssueOptions- The request options for the/api/auth/authorization/issueAPI.authzFailOptions- The request options for the/api/auth/authorization/failAPI.- 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.82
-
handle
public javax.ws.rs.core.Response handle(AuthorizationDecisionHandler.Params params, com.authlete.common.api.Options authzIssueOptions, com.authlete.common.api.Options authzFailOptions) 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()
-
-