public static OAuth20TokenExchangeTypes from(final String typeName) {
        return Arrays.stream(values()).filter(type -> type.getType().equalsIgnoreCase(typeName)).findFirst()
            .orElseThrow(() -> new IllegalArgumentException("Unknown token type: " + typeName));
    }
From token exchange type name to proper type.

@param typeName the type name
@return  exchange type
support/cas-server-support-oauth-api/src/main/java/org/apereo/cas/support/oauth/OAuth20TokenExchangeTypes.java