public function allowGrantType($grantType)
    {
        if ($grantType instanceof IGrantType) {
            $this->grantTypes[] = get_class($grantType);
        } else if (is_string($grantType) && class_exists($grantType) && is_subclass_of($grantType, 'OAuth2\\GrantType\\IGrantType')) {
            $this->grantTypes[] = $grantType;
        } else {
            throw new \InvalidArgumentException(
                "Grant type has to be fully qualified class name or instance of OAuth2\\GrantType\\IGrantType."
            );
        }
    }