ApiV2Authenticator

package

Default

Methods

ApiV2Authenticator constructor.

__construct(\Slim\Slim $api, array $uri) 

Arguments

$api

\Slim\Slim

$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

api

api : \Slim\Slim
var

Type(s)

\Slim\Slim

uri

uri : array
var

Type(s)

array