protected ResponseEntity handleMismatchedClaims(
        final HttpServletRequest request,
        final HttpServletResponse response,
        final UserProfile profileResult,
        final UmaResourceSetClaimPermissionResult analysisResult,
        final UmaPermissionTicket permissionTicket) {

        val model = new LinkedHashMap<String, Object>();
        model.put(OAuth20Constants.ERROR, OAuth20Constants.NEED_INFO);

        val claims = new UmaAuthorizationNeedInfoResponse();
        claims.setRedirectUser(true);
        claims.setTicket(permissionTicket.getId());

        val requiredClaims = analysisResult.getDetails()
            .values()
            .stream()
            .map(err -> err.getUnmatchedClaims().keySet().stream().map(String::toString).collect(Collectors.toSet()))
            .flatMap(Set::stream)
            .collect(Collectors.toSet());
        claims.setRequiredClaims(requiredClaims);

        val requiredScopes = analysisResult.getDetails()
            .values()
            .stream()
            .map(err -> err.getUnmatchedScopes().stream().map(String::toString).collect(Collectors.toSet()))
            .flatMap(Set::stream)
            .collect(Collectors.toSet());
        claims.setRequiredScopes(requiredScopes);

        val details = CollectionUtils.wrap(OAuth20Constants.REQUESTING_PARTY_CLAIMS, claims);
        model.put(OAuth20Constants.ERROR_DETAILS, details);

        return new ResponseEntity(model, HttpStatus.PERMANENT_REDIRECT);
    }
Handle authorization request.

@param body     the body
@param request  the request
@param response the response
@return the response entity
support/cas-server-support-oauth-uma-core/src/main/java/org/apereo/cas/uma/web/controllers/authz/UmaAuthorizationRequestEndpointController.java