static boolean isAuthorizedGrantTypeForService(final String grantType,
                                                   final OAuthRegisteredService registeredService,
                                                   final boolean rejectUndefined) {
        if (registeredService.getSupportedGrantTypes() != null && !registeredService.getSupportedGrantTypes().isEmpty()) {
            LOGGER.debug("Checking grant type [{}] against supported grant types [{}]", grantType, registeredService.getSupportedGrantTypes());
            return registeredService.getSupportedGrantTypes().stream().anyMatch(s -> s.equalsIgnoreCase(grantType));
        }

        LOGGER.warn("Registered service [{}] does not define any authorized/supported grant types. "
            + "It is STRONGLY recommended that you authorize and assign grant types to the service definition. "
            + "While just a warning for now, this behavior will be enforced by CAS in future versions.", registeredService.getName());
        return !rejectUndefined;
    }
Is authorized grant type for service?

@param grantType         the grant type
@param registeredService the registered service
@param rejectUndefined   the reject undefined
@return true /false
support/cas-server-support-oauth-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20RequestParameterResolver.java