Class Socialveo\Core\library\OAuth2Storage

InheritanceSocialveo\Core\library\OAuth2Storage » OAuth2\Storage\Pdo

Class OAuth2Storage

Public Methods

Hide inherited methods

MethodDescriptionDefined By
checkUserCredentials() Check user credentials Socialveo\Core\library\OAuth2Storage
getAccessToken() Get access token Socialveo\Core\library\OAuth2Storage
getClientCryptKey() Get client crypt key Socialveo\Core\library\OAuth2Storage
getUser() Fetches a user info array from database for given username or email address Implements OAuth2\Storage\UserCredentialsInterface Socialveo\Core\library\OAuth2Storage
setAccessToken() Set access token Socialveo\Core\library\OAuth2Storage
setCache() Setter function for cache Socialveo\Core\library\OAuth2Storage
setLifetime() Setter function for lifetime Socialveo\Core\library\OAuth2Storage
setUser() Change user password Socialveo\Core\library\OAuth2Storage
setUserTable() Setter function for user table Socialveo\Core\library\OAuth2Storage

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkPassword() Verifies if provided user password is correct Socialveo\Core\library\OAuth2Storage

Property Details

$cache protected property (available since version 1.0)
protected object $cache null
$lifetime protected property (available since version 1.0)

Cache life time

protected integer $lifetime 86400

Method Details

checkPassword() protected method (available since version 1.0)

Verifies if provided user password is correct

protected boolean checkPassword ( $user, $password )
$user string
$password string
checkUserCredentials() public method (available since version 1.0)

Check user credentials

Check to see if user and password are valid. Implements OAuth2\Storage\UserCredentialsInterface

public boolean checkUserCredentials ( $username, $password )
$username string
$password string
getAccessToken() public method (available since version 1.0)

Get access token

Retrieves access token object from cache, returns it if present or fetches from database and saves to cache. Implements OAuth2\Storage\AccessTokenInterface

public object getAccessToken ( $access_token )
$access_token string
return object

$token

getClientCryptKey() public method (available since version 1.0)

Get client crypt key

public mixed getClientCryptKey ( $client_id )
$client_id string
return mixed

Client crypt key or false on fail

getUser() public method (available since version 1.0)

Fetches a user info array from database for given username or email address Implements OAuth2\Storage\UserCredentialsInterface

public array getUser ( $username )
$username string

Username or email address

setAccessToken() public method (available since version 1.0)

Set access token

Saves an access token object to database and cache. Implements OAuth2\Storage\AccessTokenInterface

public boolean setAccessToken ( $access_token, $client_id, $user_id, $expires, $scope null )
$access_token string
$client_id string
$user_id string

Refers to user UUID in our case

$expires integer
$scope string
setCache() public method (available since version 1.0)

Setter function for cache

public void setCache ( $cache )
$cache object
setLifetime() public method (available since version 1.0)

Setter function for lifetime

public void setLifetime ( $lifetime )
$lifetime integer
setUser() public method (available since version 1.0)

Change user password

WARNING: Changing user password via oauth server is not supported, potential security hole. This method is not implemented. Implements OAuth2\Storage\UserCredentialsInterface

public boolean setUser ( $username, $password, $firstName null, $lastName null )
$username string
$password string
$firstName string
$lastName string
setUserTable() public method (available since version 1.0)

Setter function for user table

public void setUserTable ( $table )
$table string