ShiroAuth

Factory interface for creating Apache Shiro 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 Shiro auth provider

create( $arg0,  $arg1,  $arg2 = null) : \io\vertx\jphp\ext\auth\shiro\ShiroAuth
static

param $vertx [Vertx] the Vert.x instance param $options [ShiroAuthOptions | array] the Shiro configuration options create($vertx, $options)

Create a Shiro auth provider

param $vertx [Vertx] the Vert.x instance param $realmType [string] the Shiro realm type param $config [array] the config this method is deprecated create($vertx, $realmType, $config)

Arguments

$arg0

Vertx

$arg1

string | array | ShiroAuthOptions

$arg2

array

Response

\io\vertx\jphp\ext\auth\shiro\ShiroAuth

the auth provider

Set the role prefix to distinguish from permissions when checking for isPermitted requests.

setRolePrefix( $arg0) : \io\vertx\jphp\ext\auth\shiro\ShiroAuth

Arguments

$arg0

string

Response

\io\vertx\jphp\ext\auth\shiro\ShiroAuth

a reference to this for fluency

Constants

The default role prefix

DEFAULT_ROLE_PREFIX
var

php文件只是为了写代码方便,常量的实际值请参考原java文件