@PostMapping(value = OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants.INTROSPECTION_URL,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Handle OAuth introspection request")
    public ResponseEntity handlePostRequest(final HttpServletRequest request, final HttpServletResponse response) throws Throwable {
        try {
            val context = new JEEContext(request, response);
            val credentialsResult = extractCredentials(context);
            if (credentialsResult.isEmpty()) {
                LOGGER.warn("Unable to locate and extract credentials from the request");
                return buildUnauthorizedResponseEntity(OAuth20Constants.INVALID_CLIENT, true);
            }

            val credentials = (UsernamePasswordCredentials) credentialsResult.get();
            val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(
                getConfigurationContext().getServicesManager(), credentials.getUsername());
            if (registeredService == null) {
                LOGGER.warn("Unable to locate service definition by client id [{}]", credentials.getUsername());
                return buildUnauthorizedResponseEntity(OAuth20Constants.INVALID_CLIENT, true);
            }

            val validationError = validateIntrospectionRequest(registeredService, credentials, request);
            if (validationError.isPresent()) {
                return validationError.get();
            }

            val tokenId = StringUtils.defaultIfBlank(request.getParameter(OAuth20Constants.TOKEN),
                request.getParameter(OAuth20Constants.ACCESS_TOKEN));

            LOGGER.debug("Located access token [{}] in the request", tokenId);

            val protocolMap = CollectionUtils.<String, Object>wrap(
                "Token", tokenId,
                "Client ID", registeredService.getClientId(),
                "Service", registeredService.getName());
            LoggingUtils.protocolMessage("OpenID Connect Introspection Request", protocolMap);

            val accessToken = fetchTokenFromRegistry(tokenId);
            val introspect = getConfigurationContext()
                .getIntrospectionResponseGenerator()
                .stream()
                .filter(generator -> generator.supports(accessToken))
                .findFirst()
                .orElseThrow()
                .generate(tokenId, accessToken);
            return buildIntrospectionEntityResponse(context, introspect);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return buildBadRequestResponseEntity(OAuth20Constants.INVALID_REQUEST);
    }
Handle post request.

@param request  the request
@param response the response
@return the response entity
@throws Throwable the throwable
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20IntrospectionEndpointController.java