1 | <?php |
||
35 | class SAMLAuthenticator implements Authenticator |
||
36 | { |
||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $name = 'SAML'; |
||
|
|||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | public static function get_name() |
||
49 | |||
50 | /** |
||
51 | * @param Controller $controller |
||
52 | * @return SAMLLoginForm |
||
53 | */ |
||
54 | public static function get_login_form(Controller $controller) |
||
58 | |||
59 | /** |
||
60 | * Sends the authentication process down the SAML rabbit hole. It will trigger |
||
61 | * the IdP redirection via the 3rd party implementation, and if successful, the user |
||
62 | * will be delivered to the SAMLController::acs. |
||
63 | * |
||
64 | * @param array $data |
||
65 | * @param HTTPRequest $request |
||
66 | * @param ValidationResult|null $result |
||
67 | * @return bool|Member|void |
||
68 | * @internal param Form $form |
||
69 | */ |
||
70 | public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null) |
||
78 | |||
79 | /** |
||
80 | * Returns the services supported by this authenticator |
||
81 | * |
||
82 | * The number should be a bitwise-OR of 1 or more of the following constants: |
||
83 | * Authenticator::LOGIN, Authenticator::LOGOUT, Authenticator::CHANGE_PASSWORD, |
||
84 | * Authenticator::RESET_PASSWORD, or Authenticator::CMS_LOGIN |
||
85 | * |
||
86 | * @return int |
||
87 | */ |
||
88 | public function supportedServices() |
||
92 | |||
93 | /** |
||
94 | * Return RequestHandler to manage the log-in process. |
||
95 | * |
||
96 | * The default URL of the RequestHandler should return the initial log-in form, any other |
||
97 | * URL may be added for other steps & processing. |
||
98 | * |
||
99 | * URL-handling methods may return an array [ "Form" => (form-object) ] which can then |
||
100 | * be merged into a default controller. |
||
101 | * |
||
102 | * @param string $link The base link to use for this RequestHandler |
||
103 | * @return LoginHandler |
||
104 | */ |
||
105 | public function getLoginHandler($link) |
||
109 | |||
110 | /** |
||
111 | * Return the RequestHandler to manage the log-out process. |
||
112 | * |
||
113 | * The default URL of the RequestHandler should log the user out immediately and destroy the session. |
||
114 | * |
||
115 | * @param string $link The base link to use for this RequestHandler |
||
116 | * @return LogoutHandler |
||
117 | */ |
||
118 | public function getLogOutHandler($link) |
||
122 | |||
123 | /** |
||
124 | * Return RequestHandler to manage the change-password process. |
||
125 | * |
||
126 | * The default URL of the RequetHandler should return the initial change-password form, |
||
127 | * any other URL may be added for other steps & processing. |
||
128 | * |
||
129 | * URL-handling methods may return an array [ "Form" => (form-object) ] which can then |
||
130 | * be merged into a default controller. |
||
131 | * |
||
132 | * @param string $link The base link to use for this RequestHnadler |
||
133 | */ |
||
134 | public function getChangePasswordHandler($link) |
||
138 | |||
139 | /** |
||
140 | * @param string $link |
||
141 | * @return mixed |
||
142 | */ |
||
143 | public function getLostPasswordHandler($link) |
||
147 | |||
148 | /** |
||
149 | * Check if the passed password matches the stored one (if the member is not locked out). |
||
150 | * |
||
151 | * Note, we don't return early, to prevent differences in timings to give away if a member |
||
152 | * password is invalid. |
||
153 | * |
||
154 | * @param Member $member |
||
155 | * @param string $password |
||
156 | * @param ValidationResult $result |
||
157 | * @return ValidationResult |
||
158 | */ |
||
159 | public function checkPassword(Member $member, $password, ValidationResult &$result = null) |
||
163 | } |
||
164 |
This check marks private properties in classes that are never used. Those properties can be removed.