1 | <?php |
||
19 | class MultiAuthenticate extends Authenticate |
||
20 | { |
||
21 | /** |
||
22 | * @var \League\OAuth2\Server\ResourceServer |
||
23 | */ |
||
24 | protected $server; |
||
25 | |||
26 | /** |
||
27 | * @var \SMartins\PassportMultiauth\ProviderRepository |
||
28 | */ |
||
29 | protected $providers; |
||
30 | |||
31 | /** |
||
32 | * The authentication factory instance. |
||
33 | * |
||
34 | * @var \Illuminate\Contracts\Auth\Factory |
||
35 | */ |
||
36 | protected $auth; |
||
37 | |||
38 | 12 | public function __construct(ResourceServer $server, ProviderRepository $providers, Auth $auth) |
|
44 | |||
45 | /** |
||
46 | * Handle an incoming request. Authenticates the guard from access token |
||
47 | * used on request. |
||
48 | * |
||
49 | * @param \Illuminate\Http\Request $request |
||
50 | * @param \Closure $next |
||
51 | * @param string[] ...$guards |
||
52 | * @return mixed |
||
53 | * |
||
54 | * @throws \Illuminate\Auth\AuthenticationException |
||
55 | */ |
||
56 | 12 | public function handle($request, Closure $next, ...$guards) |
|
92 | |||
93 | /** |
||
94 | * Check if user acting has the required guards and scopes on request. |
||
95 | * |
||
96 | * @param \Illuminate\Foundation\Auth\User $user |
||
97 | * @param array $guards |
||
98 | * @return bool |
||
99 | */ |
||
100 | 6 | public function canBeAuthenticated(Authenticatable $user, $guards) |
|
106 | |||
107 | /** |
||
108 | * Authenticate correct guard based on token. |
||
109 | * |
||
110 | * @param \SMartins\PassportMultiauth\Provider $token |
||
111 | * @param array $guards |
||
112 | * @return void |
||
113 | * |
||
114 | * @throws \Illuminate\Auth\AuthenticationException |
||
115 | */ |
||
116 | 2 | public function authenticateTokenGuard(Token $token, $guards) |
|
125 | } |
||
126 |