\Hazaar\Auth\Adapter
MongoDB
Summary
Methods Properties Constants
get
has
set
No constants
Properties
$collection
$collection
$field_credential
$field_credential
$field_identity
$field_identity
$mongoDB
$mongoDB
Inherited
$session
$session
Methods
__construct()
__construct($mongoDB, $collection = 'users', $identity = '_id', $credential = 'password', $namespace = null, $cache_config = Array ( ) , $cache_backend = 'session')

Parameters

$mongoDB\Hazaar\MongoDB

No description

$collection

No description

$identity

No description

$credential

No description

$namespace

No description

$cache_config

No description

$cache_backend

No description

addUser()
addUser($identity, $credential)

Parameters

$identity

No description

$credential

No description

delUser()
delUser($identity)

Parameters

$identity

No description

queryAuth()
queryAuth($identity, $extras = Array ( ) )

Parameters

$identity

No description

$extras

No description

setCollection()
setCollection($collection)

Parameters

$collection

No description

setCredentialField()
setCredentialField($credential)

Parameters

$credential

No description

setIdentityField()
setIdentityField($identity)

Parameters

$identity

No description

Inherited
check()
check($credential) : boolean
Check that the supplied password is correct for the current identity.

This is useful for checking an account password before allowing something important to be updated. This does the same steps as authenticate() but doesn’t actually do the authentication.

Parameters

$credentialmixed

No description

Returns

boolean
Inherited
deauth()
deauth()
Inherited
get()
get($key)

Parameters

$key

No description

Inherited
getCredential()
getCredential($credential = null) : \null|string
Get the encrypted hash of a credential/password

This method uses the “encryption” options from the application configuration to generate a password hash based on the supplied password. If no password is supplied then the currently set credential is used.

NOTE: Keep in mind that if no credential is set, or it’s null, or an empty string, this will still return a valid hash of that empty value using the defined encryption hash chain.

Parameters

$credentialmixed

No description

Returns

\null|string
Inherited
getIdentity()
getIdentity()
Inherited
getToken()
getToken()
Inherited
getTokenType()
getTokenType()
Inherited
getUserData()
getUserData()
Inherited
has()
has($key)

Parameters

$key

No description

Inherited
offsetExists()
offsetExists($key)
Array Access Methods

These methods allows accessing user data as array attributes of the auth object. These methods do not allow this data to be modified in any way.

Parameters

$key

No description

Inherited
offsetGet()
offsetGet($key)

Parameters

$key

No description

Inherited
offsetSet()
offsetSet($key, $value)

Parameters

$key

No description

$value

No description

Inherited
offsetUnset()
offsetUnset($key)

Parameters

$key

No description

Inherited
set()
set($key, $value)

Parameters

$key

No description

$value

No description

Inherited
setCredential()
setCredential($credential)

Parameters

$credential

No description

Inherited
setDataFields()
setDataFields($fields)

Parameters

$fieldsarray

No description

Inherited
setIdentity()
setIdentity($identity)

Parameters

$identity

No description

Inherited
unauthorised()
unauthorised()
Helper method that sets the basic auth header and throws an unauthorised exception

Tags

Throws

\Exception