Class 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
    • 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 of handle(ticket, claimNames, claimLocales, null, null).
        Parameters:
        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.
        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 the handle(Params, Options, Options) method.
        Parameters:
        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.
        authzIssueOptions - The request options for the /api/auth/authorization/issue API.
        authzFailOptions - The request options for the /api/auth/authorization/fail 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.
        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()
      • unexpected

        protected javax.ws.rs.InternalServerErrorException unexpected​(String message,
                                                                      Throwable cause)