\Social\Providers\AbstractProviderAbstractProvider

Class AbstractProvider handle generic functionality of all (extending) social media providers

Summary

Methods
Properties
Constants
__construct()
getRedirectRoute()
sendClientRequest()
No public properties found
No constants found
setProviderName()
updateAuthorisationParams()
updateAccessParams()
handleAccessTokenResponse()
processUserProfile()
checkReturnedQuery()
getQuery()
setCsrf()
getCsrf()
checkCsrf()
$socialManager
$csrf
$providerName
$authorisationParams
$accessParams
$callback
$action
N/A
No private methods found
No private properties found
N/A

Properties

$socialManager

$socialManager : \Social\Service\SocialManager

The manager that handles basic logic for the Social module

Type

\Social\Service\SocialManager

$csrf

$csrf : string

The hashed string to add extra level of security Stands for cross site request forgery

Type

string — hash

$providerName

$providerName : string

The name of the social provider Set in actual named provider

Type

string

$authorisationParams

$authorisationParams : array

The basic parameters to append to the initial call to the provider

Type

array

$accessParams

$accessParams : array

Basic former for access params array

Type

array

$callback

$callback : string

The URI that the provider returns to

Type

string

$action

$action : string

social login or registration

Type

string

Methods

__construct()

__construct(\Social\Service\SocialManager  $socialManager) 

Constructor Instantiate (extending) class and pass Social manager and set the extending social provider name.

Parameters

\Social\Service\SocialManager $socialManager

getRedirectRoute()

getRedirectRoute(string  $callback) : string

Get the full redirect URL (including query string)

Parameters

string $callback

Returns

string —

full redirect URL

sendClientRequest()

sendClientRequest(string  $callback, array  $queryParams) : array

Send Client Request Form client request URL with query params and send via Zend Client

Parameters

string $callback

the callback URL

array $queryParams

parameters to append to end of callback URL

Returns

array —

that contains the user profile

setProviderName()

setProviderName() 

Set provider name Overridden by 'real' providers that give actual name of the provider

updateAuthorisationParams()

updateAuthorisationParams() 

Update authorisation parameters Different (but simular) in each provider

updateAccessParams()

updateAccessParams(array  $queryParams) 

Update Access Parameters Different (but simular) in each provider

Parameters

array $queryParams

handleAccessTokenResponse()

handleAccessTokenResponse(\Zend\Http\Client  $client, \Social\Providers\AbstractProvider\Response  $response) 

Handle Access Token Response Different (but simular) in each provider

Parameters

\Zend\Http\Client $client
\Social\Providers\AbstractProvider\Response $response

processUserProfile()

processUserProfile(\Social\Providers\AbstractProvider\Response  $response) 

Process user profile Different in each provider

Parameters

\Social\Providers\AbstractProvider\Response $response

checkReturnedQuery()

checkReturnedQuery(array  $params) 

Check the query string provided by the social provider to ensure that it has the keys code and state and that the value of state corresponds to the CSRF value that was sent to the provider

Parameters

array $params

the params that need checking

Throws

\Exception

getQuery()

getQuery() : string

Get HTTP query string after setting up basic values for authorisationParams array

Returns

string —

the HTT{ query string

setCsrf()

setCsrf() : string

Set (new) csrf hashed string

Returns

string —

csrf hash

getCsrf()

getCsrf(boolean  $regenerate = false) : string

Get hashed security string

Parameters

boolean $regenerate

whether to create a new one if one already exists

Returns

string —

hashed csrf

checkCsrf()

checkCsrf(string  $value) : boolean

Check whether the hash value matches the original created in getCsrf()

Parameters

string $value

the hashed value to check

Returns

boolean —

whether passed value is valid