1 | <?php |
||
22 | class SkautisAuthenticator extends AbstractGuardAuthenticator //implements GuardAuthenticatorInterface |
||
|
|||
23 | { |
||
24 | const SKAUTIS_LOGIN_ID = "skautis_login_id"; |
||
25 | const SKAUTIS_PERSON_ID = "skautis_person_id"; |
||
26 | const SKAUTIS_USERNAME = "skautis_username"; |
||
27 | |||
28 | /** |
||
29 | * @var RouterInterface |
||
30 | */ |
||
31 | protected $router; |
||
32 | |||
33 | /** |
||
34 | * @var Skautis |
||
35 | */ |
||
36 | protected $skautis; |
||
37 | |||
38 | /** |
||
39 | * @var Session |
||
40 | */ |
||
41 | protected $session; |
||
42 | |||
43 | /** |
||
44 | * @var UserLoader |
||
45 | */ |
||
46 | protected $userLoader; |
||
47 | |||
48 | /** |
||
49 | * @var bool |
||
50 | */ |
||
51 | protected $confirm; |
||
52 | |||
53 | /** |
||
54 | * @var bool |
||
55 | */ |
||
56 | protected $anonymousSkautLogin; |
||
57 | |||
58 | /** |
||
59 | * SkautisAuthenticator constructor. |
||
60 | * @param Skautis $skautis |
||
61 | * @param RouterInterface $router |
||
62 | * @param Session $session |
||
63 | * @param UserLoader $userLoader |
||
64 | * @param bool $confirm |
||
65 | * @param bool $anonymousSkautLogin |
||
66 | */ |
||
67 | public function __construct(Skautis $skautis, RouterInterface $router, Session $session, UserLoader $userLoader, $confirm = true, $anonymousSkautLogin = false) |
||
68 | { |
||
69 | $this->skautis = $skautis; |
||
70 | $this->router = $router; |
||
71 | $this->session = $session; |
||
72 | $this->userLoader = $userLoader; |
||
73 | $this->confirm = $confirm; |
||
74 | $this->anonymousSkautLogin = $anonymousSkautLogin; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | public function start(Request $request, AuthenticationException $authException = null) |
||
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | public function getCredentials(Request $request) |
||
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | public function getUser($credentials, UserProviderInterface $userProvider) |
||
138 | |||
139 | /** |
||
140 | * @inheritdoc |
||
141 | */ |
||
142 | public function checkCredentials($credentials, UserInterface $user) |
||
147 | |||
148 | /** |
||
149 | * @inheritdoc |
||
150 | */ |
||
151 | public function onAuthenticationFailure(Request $request, AuthenticationException $exception) |
||
155 | |||
156 | /** |
||
157 | * @inheritdoc |
||
158 | */ |
||
159 | public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey) |
||
163 | |||
164 | /** |
||
165 | * @inheritdoc |
||
166 | */ |
||
167 | public function supportsRememberMe() |
||
171 | } |