JWTAuth

Factory interface for creating JWT based @see \io\vertx\jphp\ext\auth\AuthProvider instances.

package

Default

Methods

__construct

__construct() 

Authenticate a user.

authenticate( $arg0,  $arg1) : void

The first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:

  {
    "username": "tim",
    "password": "mypassword"
  }
For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.

If the user is successfully authenticated a object is passed to the handler in an \io.vertx.core.AsyncResult. The user object can then be used for authorisation.

Arguments

$arg0

array

$arg1

callable

Create a JWT auth provider

create( $arg0,  $arg1) : \io\vertx\jphp\ext\auth\jwt\JWTAuth
static

Arguments

$arg0

Vertx

$arg1

JWTAuthOptions | array

Response

\io\vertx\jphp\ext\auth\jwt\JWTAuth

the auth provider

Generate a new JWT token.

generateToken( $arg0,  $arg1 = null) : string

param $claims [array] Json with user defined claims for a list of official claims generateToken($claims)

Generate a new JWT token.

param $claims [array] Json with user defined claims for a list of official claims param $options [JWTOptions | array] extra options for the generation generateToken($claims, $options)

Arguments

$arg0

array

$arg1

array | JWTOptions

Response

string

JWT encoded token