PhpCas client for the Laravel Framework 5.5.
Yanghaiquan
create auth middleware then set the handle method like this:
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
PhpCas::handLogoutRequest();
return PhpCas::checkAuthentication($request,$next,function ($userId){
$user = User::firstOrNew(['mobile' => $userId],['password' => bcrypt(123456)]);
return Auth::loginUsingId($user->id);
});
}
The Laravel framework is open-sourced software licensed under the MIT license.