phpDocumentor

ApiV2Authenticator
in package

Table of Contents

$method  : string
$request  : Request
$response  : Response
$uri  : array<string|int, mixed>
__construct()  : mixed
ApiV2Authenticator constructor.
authorize()  : mixed
Authorize request with HTTP Basic Authorization
authorizeBasicAuth()  : mixed
Authorizes requests by Basic Auth.
authorizeBearer()  : mixed
Authorize requests with JWT header.

Properties

Methods

__construct()

ApiV2Authenticator constructor.

public __construct(Request $request, Response $response, array<string|int, mixed> $uri) : mixed
Parameters
$request : Request
$response : Response
$uri : array<string|int, mixed>
Return values
mixed

authorize()

Authorize request with HTTP Basic Authorization

public authorize(string $controllerName) : mixed

Call this method in every API operation that needs to be authorized with the HTTP Basic Authorization technique.

Parameters
$controllerName : string

Name of the parent controller for this api call.

Tags
link

Not available to child-controllers (private method).

throws
HttpApiV2Exception

If request does not provide the "Authorization" header or if the credentials are invalid.

throws
InvalidArgumentException

If the username or password values are invalid.

throws
JsonWebTokenException

If a JWT supplied via “Authorization: Bearer” is found to be invalid

Return values
mixed

authorizeBasicAuth()

Authorizes requests by Basic Auth.

protected authorizeBasicAuth( $controllerName) : mixed
Parameters
$controllerName :
Tags
throws
HttpApiV2Exception
Return values
mixed

Search results