| 1 | <?php |
||
| 20 | class CallbackAuthenticator extends AbstractAuthenticator |
||
| 21 | { |
||
| 22 | /** Stores the callback to be used for authentication.*/ |
||
| 23 | private $callback; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Wrap another authentication mechanism via a callback. |
||
| 27 | * |
||
| 28 | * @param Closure $callback The callback, which is expected to have the same signature as $this->authenticate. |
||
| 29 | */ |
||
| 30 | 3 | public function __construct(Closure $callback) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Authenticate a set of credentials using a callback. |
||
| 37 | * |
||
| 38 | * @param mixed $credentials One or more credentials; A string password, or an array for multi-factor auth. |
||
| 39 | * @return bool Returns true if the identity was authenticated, or false otherwise. |
||
| 40 | */ |
||
| 41 | 3 | public function authenticate($credentials) |
|
| 45 | } |
||
| 46 |