PHP Class ZF\OAuth2\Adapter\MongoAdapter

Inheritance: extends OAuth2\Storage\Mongo
Show file Open project: zfcampus/zf-oauth2 Class Usage Examples

Protected Properties

Property Type Description
$bcrypt Zend\Crypt\Password\Bcrypt
$bcryptCost integer

Public Methods

Method Description
__construct ( $connection, array $config = [] )
checkClientCredentials ( string $client_id, string $client_secret = null ) : boolean Check client credentials
getBcrypt ( ) : Zend\Crypt\Password\Bcrypt
setBcryptCost ( $value )
setClientDetails ( string $client_id, string $client_secret = null, string $redirect_uri = null, string $grant_types = null, string $scope_or_user_id = null, string $user_id = null ) : boolean Set client details
setUser ( string $username, string $password, string $firstName = null, string $lastName = null ) : boolean Set the user

Protected Methods

Method Description
checkPassword ( string $user, string $password ) : boolean Check password using bcrypt
createBcryptHash ( &$string )
verifyHash ( $check, $hash ) : boolean Check hash using bcrypt

Method Details

__construct() public method

public __construct ( $connection, array $config = [] )
$connection
$config array

checkClientCredentials() public method

Check client credentials
public checkClientCredentials ( string $client_id, string $client_secret = null ) : boolean
$client_id string
$client_secret string
return boolean

checkPassword() protected method

Check password using bcrypt
protected checkPassword ( string $user, string $password ) : boolean
$user string
$password string
return boolean

createBcryptHash() protected method

protected createBcryptHash ( &$string )
$string

getBcrypt() public method

public getBcrypt ( ) : Zend\Crypt\Password\Bcrypt
return Zend\Crypt\Password\Bcrypt

setBcryptCost() public method

public setBcryptCost ( $value )
$value

setClientDetails() public method

Set client details
public setClientDetails ( string $client_id, string $client_secret = null, string $redirect_uri = null, string $grant_types = null, string $scope_or_user_id = null, string $user_id = null ) : boolean
$client_id string
$client_secret string
$redirect_uri string
$grant_types string
$scope_or_user_id string If 5 arguments, user_id; if 6, scope.
$user_id string
return boolean

setUser() public method

Set the user
public setUser ( string $username, string $password, string $firstName = null, string $lastName = null ) : boolean
$username string
$password string
$firstName string
$lastName string
return boolean

verifyHash() protected method

Check hash using bcrypt
protected verifyHash ( $check, $hash ) : boolean
$check
$hash
return boolean

Property Details

$bcrypt protected property

protected Bcrypt,Zend\Crypt\Password $bcrypt
return Zend\Crypt\Password\Bcrypt

$bcryptCost protected property

protected int $bcryptCost
return integer