Final Class Yiisoft\Auth\Method\HttpCookie
| Inheritance | Yiisoft\Auth\Method\HttpCookie |
|---|---|
| Implements | Yiisoft\Auth\AuthenticationMethodInterface |
HTTP cookie authentication method.
See also https://tools.ietf.org/html/rfc6265.
Public Methods
Method Details
| public mixed __construct ( Yiisoft\Auth\IdentityWithTokenRepositoryInterface $identityRepository ) | ||
| $identityRepository | Yiisoft\Auth\IdentityWithTokenRepositoryInterface | |
public function __construct(
private IdentityWithTokenRepositoryInterface $identityRepository
) {
}
| public Yiisoft\Auth\IdentityInterface|null authenticate ( \Psr\Http\Message\ServerRequestInterface $request ) | ||
| $request | \Psr\Http\Message\ServerRequestInterface | |
public function authenticate(ServerRequestInterface $request): IdentityInterface|null
{
$authToken = $this->getAuthenticationToken($request);
if ($authToken === null) {
return null;
}
return $this->identityRepository->findIdentityByToken($authToken, $this->tokenType);
}
| public \Psr\Http\Message\ResponseInterface challenge ( \Psr\Http\Message\ResponseInterface $response ) | ||
| $response | \Psr\Http\Message\ResponseInterface | |
public function challenge(ResponseInterface $response): ResponseInterface
{
return $response;
}
| public self withCookieName ( string $cookieName ) | ||
| $cookieName | string | |
public function withCookieName(string $cookieName): self
{
$new = clone $this;
$new->cookieName = $cookieName;
return $new;
}
| public self withTokenType ( string|null $type ) | ||
| $type | string|null | |
public function withTokenType(?string $type): self
{
$new = clone $this;
$new->tokenType = $type;
return $new;
}
Signup or Login in order to comment.