public class AuthorizationDecisionHandler extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
AuthorizationDecisionHandler.Params
Parameters for this handler.
|
Constructor and Description |
---|
AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api,
AuthorizationDecisionHandlerSpi spi)
Constructor with an implementation of
AuthleteApi interface
and an implementation of AuthorizationDecisionHandlerSpi
interface. |
Modifier and Type | Method and 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) |
public AuthorizationDecisionHandler(com.authlete.common.api.AuthleteApi api, AuthorizationDecisionHandlerSpi spi)
AuthleteApi
interface
and an implementation of AuthorizationDecisionHandlerSpi
interface.api
- Implementation of AuthleteApi
interface.spi
- Implementation of AuthorizationDecisionHandlerSpi
interface.public javax.ws.rs.core.Response handle(String ticket, String[] claimNames, String[] claimLocales) throws javax.ws.rs.WebApplicationException
ticket
- A ticket that was issued by Authlete's /api/auth/authorization
API.claimNames
- Names of requested claims. Use the value of the claims
parameter in a response from Authlete's /api/auth/authorization
API.claimLocales
- Requested claim locales. Use the value of the claimsLocales
parameter in a response from Authlete's /api/auth/authorization
API.javax.ws.rs.WebApplicationException
- An error occurred.public javax.ws.rs.core.Response handle(AuthorizationDecisionHandler.Params params) throws javax.ws.rs.WebApplicationException
params
- Parameters necessary to handle the decision.javax.ws.rs.WebApplicationException
- An error occurred.protected com.authlete.jaxrs.AuthleteApiCaller getApiCaller()
Copyright © 2023. All rights reserved.