@PostMapping("/authzen")
    @Operation(summary = "Authorize request via OpenID Connect AuthZen API",
        requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
            required = true,
            description = "AuthZenRequest JSON payload",
            content = @Content(
                mediaType = MediaType.APPLICATION_JSON_VALUE,
                schema = @Schema(implementation = AuthorizationRequest.class)
            )
        ))
    public ResponseEntity authzen(
        @RequestBody
        final @Valid AuthorizationRequest authorizationRequest,
        final HttpServletRequest request) {

        try {
            Assert.notNull(authorizationRequest.getSubject(), "Method cannot be null");
            Assert.notNull(authorizationRequest.getAction(), "URI cannot be null");
            Assert.notNull(authorizationRequest.getResource(), "Namespace cannot be null");
            Assert.notNull(authorizationRequest.getContext(), "Context cannot be null");
            
            val requestToAuthorize = prepareAuthorizationRequest(authorizationRequest, request);
            requestToAuthorize.log();
            val authorizationResponse = authorizationEngine.authorize(requestToAuthorize);
            return buildResponse(authorizationResponse);
        } catch (final Throwable e) {
            LoggingUtils.error(LOGGER, e);
            return buildResponse(AuthorizationResponse.unauthorized(e.getMessage()));
        }
    }
AuthZen access evaluation API.

@param authorizationRequest the authorization request
@param request              the request
@return the response entity
support/cas-server-support-heimdall/src/main/java/org/apereo/cas/heimdall/HeimdallAuthorizationController.java