public static boolean isGrantType(final String type, final OAuth20GrantTypes expectedType) {
        return expectedType.getType().equalsIgnoreCase(type);
    }
Check the grant type against an expected grant type.

@param type         the given grant type
@param expectedType the expected grant type
@return whether the grant type is the expected one
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java