public function getAuthenticationUrl($type = 'private')
    {
        if (!$this->getRedirect()) {
            throw new \Exception('please set a redirect url for your permissions request');
        }

        $config = $this->getConfig();
        if (!isset($config['dataset'][$type])) {
            // @todo Is this configurable?
            throw new \Exception('unknown action. please check your apiconfig.yml file for the available types');
        }

        $params = array();
        $params['response_type'] = 'code';
        $params['client_id'] = $config['api_key'];
        $params['redirect_uri'] = $this->getRedirect();
        $params['scope'] = $config['dataset'][$type]['scope'];
        $params['state'] = $this->resetState()->getState();

        $url = $config['urls']['auth'] . '?' . http_build_query($params);

        return $url;
    }