class vB_Library_ExternalLogin_OAuth extends vB_Library_ExternalLogin

vB_Library_Auth

Traits

Properties

static protected $instance from vB_Library
protected $loginlibraryid from vB_Library_ExternalLogin
protected $productid from vB_Library_ExternalLogin
protected $package
protected $url_request_token
protected $url_authenticate
protected $url_access_token
protected $oauth_callback
protected $http_method
protected $oauth_consumer_key
protected $oauth_consumer_secret
protected $oauth_token
protected $oauth_token_secret
protected $oauth_signature_method
protected $oauth_timestamp
protected $oauth_version
protected $oauth_nonce
protected $debug_mode
protected $do_log
protected $error

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

static vB_PageCache
instance($class)

Returns singleton instance of self.

static 
getLibraryClassNameInternal($controller)

No description

static 
getContentInstance($contenttypeid)

No description

static 
clearCache()

No description

createLoginLibraryId($productid = "", $class = "")

No description

getLoginLibraryId($productid = "")

No description

checkLinkSuccess($newUserAuth)

No description

updateUserAuthRecord($data)

No description

checkExternalUseridAvailability($external_userid)

No description

getUserAuthRecord($external_userid = null, $token = null, $userid = null)

No description

getSessionAuthRecord($token = null)

No description

linkCurrentUserWithApp($params = array())

Convert request token to access token, fetch external userid (using plugin implemented fetchAndSetExternalUserid() function) and update userauth record to link the app with the current user.

unlinkCurrentUserFromApp($params = array())

No description

getNonce($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567')

No description

loginUser($vbuserid)

No description

saveUserLink($userAuth)

No description

postUserDelete($userid)

No description

getPersonalData($userid)

No description

array
formatPersonalDataForExport($userauth)

Given userauth record & the loginlibrary data, fetch any additional personal data stored for the user & format it for export.

getAndSetCurrentUserData()

No description

clearOAuthTokenAndSecret()

No description

setOAuthTokenAndSecret($userAuth)

No description

Array
convertRequestTokenToAccessToken(Array $params)

Convert a pair of request token+secret (linked to an app) to an "access" token+secret (linked to a 3rd-party/twitter user).

parseRequestError($statusCode, $responseBody)

No description

getLinkedVBUseridFromRequestTokens($params)

No description

fetchExternalUserid($userAuth)

No description

cleanUpUserauthBeforeLinking($userAuth)

No description

cleanUpUserauthAfterConvertingGuestToken($userAuth)

No description

getParameterString($params = array())

No description

clearError()

No description

doPOSTRequest($url, $parameters)

No description

parseResponseBody($body)

No description

doGETRequest($url, $parameters)

No description

fetchRequestToken($oauth_callback)

No description

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 95
__construct()

in vB_Library at line 35
static vB_PageCache instance($class)

Returns singleton instance of self.

Parameters

$class

Return Value

vB_PageCache
  • Reference to singleton instance of the cache handler

in vB_Library at line 52
static protected getLibraryClassNameInternal($controller)

Parameters

$controller

in vB_Library at line 91
static getContentInstance($contenttypeid)

Parameters

$contenttypeid

in vB_Library at line 99
static clearCache()

final createLoginLibraryId($productid = "", $class = "")

Parameters

$productid
$class

final protected getLoginLibraryId($productid = "")

Parameters

$productid

protected checkLinkSuccess($newUserAuth)

Parameters

$newUserAuth

final protected updateUserAuthRecord($data)

Parameters

$data

final protected checkExternalUseridAvailability($external_userid)

Parameters

$external_userid

final getUserAuthRecord($external_userid = null, $token = null, $userid = null)

Parameters

$external_userid
$token
$userid

final protected deleteUserAuthRecord()

final protected updateSessionAuthRecord($data)

Parameters

$data

final getSessionAuthRecord($token = null)

Parameters

$token

final protected deleteSessionAuthRecord()

final protected removeExpiredSessionAuths()

at line 237
linkCurrentUserWithApp($params = array())

Convert request token to access token, fetch external userid (using plugin implemented fetchAndSetExternalUserid() function) and update userauth record to link the app with the current user.

Parameters

$params

unlinkCurrentUserFromApp($params = array())

Parameters

$params

protected getNonce($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567')

Parameters

$length
$chars

final loginUser($vbuserid)

Parameters

$vbuserid

Parameters

$userAuth

postUserDelete($userid)

Parameters

$userid

final getPersonalData($userid)

Parameters

$userid

array formatPersonalDataForExport($userauth)

Given userauth record & the loginlibrary data, fetch any additional personal data stored for the user & format it for export.

Parameters

$userauth array userauth and loginlibrary data for the user, including the following data: - int userid - string external_userid - array additional_params - string token - string token_secret - int loginlibraryid - int productid - string class

Return Value

array each key should be a phrase title, and value should be the stored data

at line 102
protected getAndSetCurrentUserData()

at line 109
protected clearOAuthTokenAndSecret()

at line 116
protected setOAuthTokenAndSecret($userAuth)

Parameters

$userAuth

at line 141
protected Array convertRequestTokenToAccessToken(Array $params)

Convert a pair of request token+secret (linked to an app) to an "access" token+secret (linked to a 3rd-party/twitter user).

Note that this function "consumed" the sessionauth record.

Parameters

Array $params Array with 'oauth_token' & 'oauth_verifier', which are usually supplied by the 3rd party (when they redirect the user back to us via the oauth_callback) as query params.

Return Value

Array
  • Bool 'success' if success is false: - String 'error' error phrasetitle if success is true: - Array 'postresponse' curl post response array - String 'oauth_token' - String 'oauth_token_secret' - Array 'authrecord'

at line 220
protected parseRequestError($statusCode, $responseBody)

Parameters

$statusCode
$responseBody

at line 290
getLinkedVBUseridFromRequestTokens($params)

Parameters

$params

at line 356
protected fetchExternalUserid($userAuth)

Parameters

$userAuth

at line 361
protected cleanUpUserauthBeforeLinking($userAuth)

Parameters

$userAuth

at line 368
protected cleanUpUserauthAfterConvertingGuestToken($userAuth)

Parameters

$userAuth

at line 375
protected getParameterString($params = array())

Parameters

$params

at line 490
final protected clearError()

at line 495
protected doPOSTRequest($url, $parameters)

Parameters

$url
$parameters

at line 541
protected parseResponseBody($body)

Parameters

$body

at line 555
protected doGETRequest($url, $parameters)

Parameters

$url
$parameters

at line 596
protected fetchRequestToken($oauth_callback)

Parameters

$oauth_callback