0 follower

Interface Yiisoft\Auth\AuthenticationMethodInterface

Implemented byYiisoft\Auth\Debug\AuthenticationMethodInterfaceProxy, Yiisoft\Auth\Method\Composite, Yiisoft\Auth\Method\HttpBasic, Yiisoft\Auth\Method\HttpBearer, Yiisoft\Auth\Method\HttpCookie, Yiisoft\Auth\Method\HttpHeader, Yiisoft\Auth\Method\QueryParameter

The interface that should be implemented by individual authentication methods.

Public Methods

Hide inherited methods

Method Description Defined By
authenticate() Authenticates the identity based on information available from request. Yiisoft\Auth\AuthenticationMethodInterface
challenge() Adds challenge to response upon authentication failure. Yiisoft\Auth\AuthenticationMethodInterface

Method Details

Hide inherited methods

authenticate() public abstract method

Authenticates the identity based on information available from request.

public abstract Yiisoft\Auth\IdentityInterface|null authenticate ( \Psr\Http\Message\ServerRequestInterface $request )
$request \Psr\Http\Message\ServerRequestInterface

Request to get identity information from.

return Yiisoft\Auth\IdentityInterface|null

An instance of identity or null if there is no match.

                public function authenticate(ServerRequestInterface $request): ?IdentityInterface;

            
challenge() public abstract method

Adds challenge to response upon authentication failure.

For example, some appropriate HTTP headers may be added.

public abstract \Psr\Http\Message\ResponseInterface challenge ( \Psr\Http\Message\ResponseInterface $response )
$response \Psr\Http\Message\ResponseInterface

Response to modify.

return \Psr\Http\Message\ResponseInterface

Modified response.

                public function challenge(ResponseInterface $response): ResponseInterface;