private AuthorizationRequest prepareAuthorizationRequest(final AuthorizationRequest authorizationRequest,
                                                             final HttpServletRequest request) throws Throwable {
        val authorizationHeader = Objects.requireNonNull(request.getHeader(HttpHeaders.AUTHORIZATION));
        Assert.hasText(authorizationHeader, "Authorization header cannot be blank");
        val principal = principalParser.parse(authorizationHeader, authorizationRequest);
        val headers = HttpRequestUtils.getRequestHeaders(request);
        val requestToAuthorize = authorizationRequest.withPrincipal(principal);
        requestToAuthorize.getContext().putAll((Map) headers);
        return requestToAuthorize;
    }
Authorize response entity.

@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