1. Go to this page and download the library: Download esyede/sso library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
protected function attemptLogin(Request $request)
{
$credentials = $this->credentials($request);
return (new \Esyede\SSO\LaravelSSOBroker)->login($credentials['phone'], $credentials['password']);
}
public function logout(Request $request)
{
(new \Esyede\SSO\LaravelSSOBroker)->logout();
$this->guard()->logout();
$request->session()->invalidate();
return redirect('/');
}
protected function attemptLogin(Request $request)
{
$broker = new LaravelSSOBroker();
$credentials = $this->credentials($request);
// this is your own field.
$loginKey = $request->input('login_key', '');
return $broker->handleLogin($credentials[$this->username()], $credentials['password'], $loginKey);
}
protected function attemptLogin(Request $request)
{
$broker = new LaravelSSOBroker();
$credentials = $this->credentials($request);
// this is your own field.
$loginKey = $request->input('login_name', '');
return $broker->handleLogin($credentials[$this->username()], $credentials['password'], $loginKey);
}