ApiV2Authenticator

package

Default

Methods

ApiV2Authenticator constructor.

__construct(\Slim\Http\ServerRequest $request, \Slim\Http\Response $response, array $uri) 

Arguments

$request

\Slim\Http\ServerRequest

$response

\Slim\Http\Response

$uri

array

Authorize request with HTTP Basic Authorization

authorize(string $controllerName) 

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

link

Not available to child-controllers (private method).

Throws
\HttpApiV2Exception

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

\InvalidArgumentException

If the username or password values are invalid.

\JsonWebTokenException

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

Arguments

$controllerName

string

Name of the parent controller for this api call.

Authorizes requests by Basic Auth.

authorizeBasicAuth( $controllerName) 
Throws
\HttpApiV2Exception

Arguments

$controllerName

Authorize requests with JWT header.

authorizeBearer( $controllerName) 
Throws
\HttpApiV2Exception
\JsonWebTokenException

Arguments

$controllerName

Properties

request

request : \Slim\Http\ServerRequest
var

Type(s)

\Slim\Http\ServerRequest

response

response : \Slim\Http\Response
var

Type(s)

\Slim\Http\Response

method

method : string
var

Type(s)

string

uri

uri : array
var

Type(s)

array