MongoAuth

An extension of AuthProvider which is using as store

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

Creates an instance of MongoAuth by using the given and configuration object. An example for a configuration object:

create( $arg0,  $arg1) : \io\vertx\jphp\ext\auth\mongo\MongoAuth
static
JsonObject js = new JsonObject();
js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));

Arguments

$arg0

MongoClient

$arg1

array

Response

\io\vertx\jphp\ext\auth\mongo\MongoAuth

the created instance of {@link MongoAuth}s

The name of the collection used to store User objects inside. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

getCollectionName() : string

Response

string

the collectionName

The HashStrategy which is used by the current instance

getHashStrategy() : \io\vertx\jphp\ext\auth\mongo\HashStrategy

Response

\io\vertx\jphp\ext\auth\mongo\HashStrategy

the defined instance of {@link HashStrategy}

Get the name of the field to be used as property for the password of credentials in the method

getPasswordCredentialField() : string
see \io\vertx\jphp\ext\auth\AuthProvider::authenticate.

Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

Response

string

the passwordCredentialField

Get the name of the field to be used for the password Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

getPasswordField() : string

Response

string

the passwordField

Get the name of the field to be used for the permissions. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth.

getPermissionField() : string

Permissions are expected to be saved as JsonArray

Response

string

the permissionField

Get the name of the field to be used for the roles. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth. Roles are expected to be saved as JsonArray

getRoleField() : string

Response

string

the roleField

Get the name of the field to be used for the salt. Only used when @see \io\vertx\jphp\ext\auth\mongo\HashStrategy::setSaltStyle is set to

getSaltField() : string

Response

string

the saltField

Get the name of the field to be used as property for the username in the method

getUsernameCredentialField() : string
see \io\vertx\jphp\ext\auth\AuthProvider::authenticate.

Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

Response

string

the usernameCredentialField

Get the name of the field to be used for the username. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

getUsernameField() : string

Response

string

the usernameField

Insert a new user into mongo in the convenient way

insertUser( $arg0,  $arg1,  $arg2,  $arg3,  $arg4) : void

Arguments

$arg0

string

$arg1

string

$arg2

array

$arg3

array

$arg4

callable

Set the name of the collection to be used. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

setCollectionName( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

The Hash Algorithm which is used by the current instance

setHashAlgorithm( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

The HashStrategy which is used by the current instance

setHashStrategy( $arg0) : $this

Arguments

$arg0

HashStrategy

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used as property for the password of credentials in the method

setPasswordCredentialField( $arg0) : $this
see \io\vertx\jphp\ext\auth\AuthProvider::authenticate.

Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used for the password Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

setPasswordField( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used for the permissions. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth.

setPermissionField( $arg0) : $this

Permissions are expected to be saved as JsonArray

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used for the roles. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth. Roles are expected to be saved as JsonArray

setRoleField( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used for the salt. Only used when @see \io\vertx\jphp\ext\auth\mongo\HashStrategy::setSaltStyle is set to

setSaltField( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used as property for the username in the method

setUsernameCredentialField( $arg0) : $this
see \io\vertx\jphp\ext\auth\AuthProvider::authenticate.

Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Set the name of the field to be used for the username. Defaults to @see \io\vertx\jphp\ext\auth\mongo\MongoAuth

setUsernameField( $arg0) : $this

Arguments

$arg0

string

Response

$this

the current instance itself for fluent calls

Constants

The property name to be used to set the name of the collection inside the config

PROPERTY_COLLECTION_NAME
var

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

The property name to be used to set the name of the field, where the username is stored inside

PROPERTY_USERNAME_FIELD
var

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

The property name to be used to set the name of the field, where the roles are stored inside

PROPERTY_ROLE_FIELD
var

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

The property name to be used to set the name of the field, where the permissions are stored inside

PROPERTY_PERMISSION_FIELD
var

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

The property name to be used to set the name of the field, where the password is stored inside

PROPERTY_PASSWORD_FIELD
var

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

The property name to be used to set the name of the field, where the username for the credentials is stored inside

PROPERTY_CREDENTIAL_USERNAME_FIELD
var

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

The property name to be used to set the name of the field, where the password for the credentials is stored inside

PROPERTY_CREDENTIAL_PASSWORD_FIELD
var

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

The property name to be used to set the name of the field, where the SALT is stored inside

PROPERTY_SALT_FIELD
var

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

The property name to be used to set the name of the field, where the salt style is stored inside

PROPERTY_SALT_STYLE
var

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

The default name of the collection to be used

DEFAULT_COLLECTION_NAME
var

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

The default name of the property for the username, like it is stored in mongodb

DEFAULT_USERNAME_FIELD
var

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

The default name of the property for the password, like it is stored in mongodb

DEFAULT_PASSWORD_FIELD
var

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

The default name of the property for the roles, like it is stored in mongodb. Roles are expected to be saved as JsonArray

DEFAULT_ROLE_FIELD
var

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

The default name of the property for the permissions, like it is stored in mongodb. Permissions are expected to be saved as JsonArray

DEFAULT_PERMISSION_FIELD
var

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

The default name of the property for the username, like it is transported in credentials by method

DEFAULT_CREDENTIAL_USERNAME_FIELD
see
var

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

The default name of the property for the password, like it is transported in credentials by method

DEFAULT_CREDENTIAL_PASSWORD_FIELD
see
var

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

The default name of the property for the salt field

DEFAULT_SALT_FIELD
var

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

The prefix which is used by the method when checking for role access

ROLE_PREFIX
var

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