ChainAuth

Chain several auth providers as if they were one. This is useful for cases where one want to authenticate across several providers, for example, database and fallback to passwd file.

package

Default

Methods

__construct

__construct() 

Appends a auth provider to the chain.

append( $arg0) : $this

Arguments

$arg0

AuthProvider

Response

$this

self

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 @see \io\vertx\jphp\ext\auth\User 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

Clears the chain.

clear() : void

Create a Chainable Auth Provider auth provider

create() : \io\vertx\jphp\ext\auth\ChainAuth
static

Response

\io\vertx\jphp\ext\auth\ChainAuth

the auth provider

Removes a provider from the chain.

remove( $arg0) : boolean

Arguments

$arg0

AuthProvider

Response

boolean

true if provider was removed, false if non existent in the chain.