public function loginWith()
    {
        $providerName = $_REQUEST["provider"];
        $redirect = $_GET['redirect'];

        $userProfile = $this->getAuthProvider()->authenticate($providerName);

        if ($userProfile instanceof Exception) {
            $this->getView()->set('exception', $userProfile);
        } else {
            $userExist = User_Logins::instance()->getUserByProvider($providerName, $userProfile->identifier);

            if (!$userExist) {
                $this->redirect(
                    $this->getModelManager()->getOAuthLinkURL([
                        'provider' => $providerName,
                        'redirect' => $redirect
                    ]));
            }

            $userExist->doAuthentication();

            $this->afterLoginRedirect();
        }
    }