@EXT\Route("/login", name="claro_cas_login")

@param Request $request

@return \Symfony\Component\HttpFoundation\Response
492214
public function loginAction(Request $request)
    {
        $request->getSession()->set('LOGGED_VIA_CAS', true);
        $manager = $this->ssoFactory->getManager('cas_sso');

        return new RedirectResponse($manager->getServer()->getLoginUrl());
    }
479450
public function login($provider, Request $request)
    {
        $user = $this->authenticateUser->authenticate($provider, $request->has('code'));

        auth()->login($user, true);

        return redirect()->intended(route('core::home'));

    }
721789
private function sendLoginResponse(Request $request)
    {
        $user = user();

        // notify message
        if ($user->getAttribute('logged_in_at')) {
            notify()->info('Info',
                'Last time you logged in was ' . $user->logged_in_at->diffForHumans(),
                'clock-o rotateIn animated', 8000);
        }
        else {
            notify()->info('Welcome',
                'Hi ' . $user->fullname . '. Welcome to ' . config('app.name'),
                'bell swing animated', 8000);
        }

        // log
        $this->logLogin($request, 'success');

        // update logged_in_at
        $user->update(['logged_in_at' => Carbon::now()]);

        $request->session()->regenerate();

        $this->clearLoginAttempts($request);

        log_activity('Login', $user->fullname . ' logged in.');

        // if admin - go to admin - else website
        $url = $user->hasRole('admin') ? "/admin" : "/";

        // if ajax (can be from a login modal)
        if (request()->ajax()) {
            return json_response(['redirect' => config('app.url') . $url]);
        }

        return redirect()->intended($url);
    }
1009447
public function postLogin(\Illuminate\Http\Request $request)
	{
		$this->validate($request, [
			'username' => 'required', 'password' => 'required',
		], [ 
			'required' => trans('common::admin.validation.required')
		]);
		
		$return_url = $request->input('return_url', '');
		if ($return_url == '') $return_url = null;

		$credentials = $request->only('username', 'password');
		
		if ($this->auth->attempt($credentials, $request->has('remember')))
		{
			if ($request->ajax())
			{
				return [ 'success' => true, 'token' => csrf_token() ];
			}
			
			return ($return_url != null ? redirect($return_url) : redirect()->route('admin-home'));
		}
		
		if ($request->ajax() || $request->wantsJson())
		{
			throw new \Illuminate\Http\Exception\HttpResponseException(
				new \Illuminate\Http\JsonResponse([ 'username' => 'Wrong username or password' ], 422)
			);
		}
		
		return redirect(route('admin-login') . '?return_url=' . urlencode($return_url))
			->withInput($request->only('username', 'remember'))
			->withErrors([
				'username' => 'Wrong username or password',
			]);
	}
439934
protected function sendRequest(Request $request): Response
    {
        // Set password authentication for request.
        if ($this->password !== null) {
            $request->authenticate($this->password);
        }

        $this->send((string) $request);
        $response = new Response($this->get());
        return $response;

    }
1148175
public function authenticate(Request $request)
    {
        return $request->get('username') === $this->username
            && password_verify($request->get('password'), $this->password);
    }
989008
public function postLogin(Request $request)
    {
        $this->validate($request, [
            'user'      => 'required',
            'password'  => 'required',
        ]);

        $credentials = $request->only('user', 'password');

        if(auth()->guard('pulsar')->attempt($credentials, $request->has('remember')))
        {
            // check if user has access
            if(!auth()->guard('pulsar')->user()->access_010)
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 3
                    ]);
            }

            // set user access control list
            session(['userAcl' => AclLibrary::getProfileAcl(auth()->guard('pulsar')->user()->profile_id_010)]);

            // check if user has permission to access
            if (!is_allowed('pulsar', 'access'))
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 2
                    ]);
            }

            session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
            session(['baseLang' => Lang::getBaseLang()]);

            return redirect()->intended($this->redirectTo);
        }

        return redirect($this->loginPath)
            ->withInput($request->only('user', 'remember'))
            ->withErrors([
                'loginErrors' => 1
            ]);
    }
304216
public function createAndLoginAction(Request $request)
    {
        //there is a little bit of computation involved here (ie, do we need to validate the account or stuff like this)
        //but keep it easy for now because an other route could be relevant
        $selfLog = true;
        $autoOrganization = $this->container
            ->get('claroline.config.platform_config_handler')
            ->getParameter('force_organization_creation');

        $organizationRepository = $this->container->get('claroline.persistence.object_manager')
            ->getRepository('ClarolineCoreBundle:Organization\Organization');

        //step one: creation the organization if it's here. If it exists, we fetch it.
        $data = $this->decodeRequest($request);

        if ($selfLog && 'anon.' === $this->container->get('security.token_storage')->getToken()->getUser()) {
            $this->options['create'][] = Options::USER_SELF_LOG;
        }

        $organization = null;

        if ($autoOrganization) {
            //try to find orga first
            //first find by vat
            if (isset($data['mainOrganization'])) {
                if (isset($data['mainOrganization']['vat']) && null !== $data['mainOrganization']['vat']) {
                    $organization = $organizationRepository
                      ->findOneBy(['vat' => $data['mainOrganization']['vat']]);
                //then by code
                } else {
                    $organization = $organizationRepository
                      ->findOneBy(['code' => $data['mainOrganization']['code']]);
                }
            }

            if (!$organization && isset($data['mainOrganization'])) {
                $organization = $this->crud->create(
                    'Claroline\CoreBundle\Entity\Organization\Organization',
                    $data['mainOrganization']
                );
            }

            //error handling
            if (is_array($organization)) {
                return new JsonResponse($organization, 400);
            }
        }

        $user = $this->crud->create(
            User::class,
            $this->decodeRequest($request),
            array_merge($this->options['create'], [Options::VALIDATE_FACET])
        );

        //error handling
        if (is_array($user)) {
            return new JsonResponse($user, 400);
        }

        if ($organization) {
            $this->crud->replace($user, 'mainOrganization', $organization);
        }

        return new JsonResponse(
            $this->serializer->serialize($user, $this->options['get']),
            201
        );
    }
1206821
public function doLogin(Request $request)
    {
        $userdata = array(
            'email'     =>  $request->email,
            'password'  =>  $request->password
        );
        
        if(\Auth::attempt($userdata, true, true))
        {
            if(config('entrance.activated')) {
                if(\Auth::user()->status != 1) {
                    // Logging the user out
                    \Auth::logout();

                    $request->session()->flash('message', 'Dit account is staat niet op active');
                    return redirect()->route('login.index');
                }
            }
            $request->session()->flash('message', 'Ingelogd');
            return redirect()->intended();
        }
        else
        {
            $request->session()->flash('message', 'E-mail of wachtwoord onjuist!');
            return redirect()->route('login.index')->withInput();
        }
    }
486870
public function loginLinkAction(Request $request)
    {
        $casLogin = $request->getSession()->get('CAS_AUTHENTICATION_USER_ID');
        if (empty($casLogin)) {
            return $this->redirectToRoute('claro_index');
        }
        $request->getSession()->set('LOGGED_VIA_CAS', true);

        return [];
    }
889255
public function authentication(Request $request)
    {
        try {
            $this->authRepositoryInterface->authenticate($request->all());
        } catch (FormValidationException $e) {
            Flash::error($e->getMessage());

            return redirect()
              ->route('auth.login')
              ->withErrors($e->getErrors());
        } catch (AuthenticationException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('auth.login');
        }

        return redirect()->route('dashboard.index');
    }
150976
public function login(Request $request)
    {
        $credentials = $request->only('email', 'password');

        try {
            if (! $token = JWTAuth::attempt($credentials)) {
                return response()->json(['error' => 'invalid_credentials'], 401);
            }
        } catch (JWTException $e) {
            return response()->json(['error' => 'could_not_create_token'], 500);
        }

        return response()->json(compact('token'));
    }
1344887
public function postLogin(Request $request)
    {
        $this->validate($request, [
            $this->loginUsername() => 'required',
            'password'             => 'required',
        ]);

        // If the class is using the ThrottlesLogins trait, we can automatically throttle
        // the login attempts for this application. We'll key this by the username and
        // the IP address of the client making these requests into this application.
        $throttles = $this->isUsingThrottlesLoginsTrait();

        if ($throttles && $this->hasTooManyLoginAttempts($request)) {
            return $this->sendLockoutResponse($request);
        }

        $credentials = $this->getCredentials($request);

        if (\Taki::attempt($credentials, $request->has('remember'))) {
            return $this->handleUserWasAuthenticated($request, $throttles);
        }

        // If the login attempt was unsuccessful we will increment the number of attempts
        // to login and redirect the user back to the login form. Of course, when this
        // user surpasses their maximum number of attempts they will get locked out.
        if ($throttles) {
            $this->incrementLoginAttempts($request);
        }

        return redirect($this->loginPath())
                ->withInput($request->only($this->loginUsername(), 'remember'))
                ->withErrors([
                    $this->loginUsername() => $this->getFailedLoginMessage(),
        ]);
    }
641174
private function attemptAuthentication(Request $request)
    {
        return $this->authenticationManager->authenticate(
            new UsernamePasswordToken(
                $request->attributes->get('username'),
                $request->attributes->get('password'),
                $this->providerKey
            )
        );
    }
304161
public function postLogin(LoginRequest $request)
    {
        $inputs = $request->except('_token','rememberme');

        $rememberme = $request->get('rememberme');

        $attemp = Auth::attempt($inputs, !!$rememberme);

        if (!$attemp) {
            $request->session()->flash('error', trans('auth.failed'));
            return Redirect::back();
        }

        return Redirect::intended('/');

    }
555291
public function login(Request $request)
    {
        try {
            $this->getApplicationBox()->get_connection();
        } catch (\Exception $e) {
            $this->app->addFlash('error', $this->app->trans('login::erreur: No available connection - Please contact sys-admin'));
        }

        $feeds = $this->getFeedRepository()->findBy(['public' => true], ['updatedOn' => 'DESC']);

        $form = $this->app->form(new PhraseaAuthenticationForm($this->app));
        $form->setData([
            'redirect' => $request->query->get('redirect')
        ]);

        return $this->render('login/index.html.twig', array_merge(
            $this->getDefaultTemplateVariables($request),
            [
                'feeds' => $feeds,
                'form'  => $form->createView(),
            ]));
    }
812881
protected function attemptLogin(Request $request)
    {
        if ($this->username() === 'email') {
            return $this->attemptLoginAtAuthenticatesUsers($request);
        }
        if (! $this->attemptLoginAtAuthenticatesUsers($request)) {
            return $this->attempLoginUsingUsernameAsAnEmail($request);
        }
        return false;
    }