Properties

$name

$name : string

Provider name.

Type

string

$clientId

$clientId : string

The client ID.

Type

string

$clientSecret

$clientSecret : string

The client secret.

Type

string

$redirectUrl

$redirectUrl : string

The redirect URL.

Type

string

$parameters

$parameters : array

The custom parameters to be sent with the request.

Type

array

$scopes

$scopes : array

The scopes being requested.

Type

array

$scopeSeparator

$scopeSeparator : string

The separating character for the requested scopes.

Type

string

$encodingType

$encodingType : integer

The type of the encoding in the query.

Type

integer — Can be either PHP_QUERY_RFC3986 or PHP_QUERY_RFC1738

$stateless

$stateless : boolean

Indicates if the session state should be utilized.

Type

boolean

$baseUrl

$baseUrl : string

The base url of QQ API.

Type

string

$openId

$openId : string

User openid.

Type

string

$withUnionId

$withUnionId : boolean

get token(openid) with unionid.

Type

boolean

$unionId

$unionId : string

User unionid.

Type

string

$uid

$uid : integer

The uid of user authorized.

Type

integer

Methods

__construct()

__construct(\Symfony\Component\HttpFoundation\Request  $request, string  $clientId, string  $clientSecret, string|null  $redirectUrl = null) 

Create a new provider instance.

Parameters

\Symfony\Component\HttpFoundation\Request $request
string $clientId
string $clientSecret
string|null $redirectUrl

redirect()

redirect(string  $redirectUrl = null) : \Symfony\Component\HttpFoundation\RedirectResponse

Redirect the user of the application to the provider's authentication screen.

Parameters

string $redirectUrl

Returns

\Symfony\Component\HttpFoundation\RedirectResponse

setRedirectUrl()

setRedirectUrl(string  $redirectUrl) : $this

Set redirect url.

Parameters

string $redirectUrl

Returns

$this

withRedirectUrl()

withRedirectUrl(string  $redirectUrl) : $this

Set redirect url.

Parameters

string $redirectUrl

Returns

$this

getRedirectUrl()

getRedirectUrl() : string

Return the redirect url.

Returns

string

getAccessToken()

getAccessToken(string  $code) : \Overtrue\Socialite\AccessToken

Get the access token for the given code.

Parameters

string $code

Returns

\Overtrue\Socialite\AccessToken

scopes()

scopes(array  $scopes) : $this

Set the scopes of the requested access.

Parameters

array $scopes

Returns

$this

stateless()

stateless() : $this

Indicates that the provider should operate as stateless.

Returns

$this

with()

with(array  $parameters) : $this

Set the custom parameters of the request.

Parameters

array $parameters

Returns

$this

getName()

getName() : string

Returns

string

parseAccessToken()

parseAccessToken(string  $body) : \Overtrue\Socialite\AccessToken

Get the access token from the token response body.

Parameters

string $body

Returns

\Overtrue\Socialite\AccessToken

withUnionId()

withUnionId() : self

Returns

self

getAuthUrl()

getAuthUrl(string  $state) : string

Get the authentication URL for the provider.

Parameters

string $state

Returns

string

getTokenUrl()

getTokenUrl() : string

Get the token URL for the provider.

Returns

string

getUserByToken()

getUserByToken(\Overtrue\Socialite\AccessTokenInterface  $token) : array

Get the raw user for the given access token.

Parameters

\Overtrue\Socialite\AccessTokenInterface $token

Returns

array

mapUserToObject()

mapUserToObject(array  $user) : \Overtrue\Socialite\User

Map the raw user array to a Socialite User instance.

Parameters

array $user

Returns

\Overtrue\Socialite\User

buildAuthUrlFromBase()

buildAuthUrlFromBase(string  $url, string  $state) : string

Get the authentication URL for the provider.

Parameters

string $url
string $state

Returns

string

getCodeFields()

getCodeFields(string|null  $state = null) : array

Get the GET parameters for the code request.

Parameters

string|null $state

Returns

array

formatScopes()

formatScopes(array  $scopes, string  $scopeSeparator) : string

Format the given scopes.

Parameters

array $scopes
string $scopeSeparator

Returns

string

hasInvalidState()

hasInvalidState() : boolean

Determine if the current request / session has a mismatching "state".

Returns

boolean

getTokenFields()

getTokenFields(string  $code) : array

Get the Post fields for the token request.

Parameters

string $code

Returns

array

getCode()

getCode() : string

Get the code from the request.

Returns

string

getHttpClient()

getHttpClient() : \GuzzleHttp\Client

Get a fresh instance of the Guzzle HTTP client.

Returns

\GuzzleHttp\Client

usesState()

usesState() : boolean

Determine if the provider is operating with state.

Returns

boolean

isStateless()

isStateless() : boolean

Determine if the provider is operating as stateless.

Returns

boolean

arrayItem()

arrayItem(array  $array, string  $key, mixed  $default = null) : mixed

Return array item by key.

Parameters

array $array
string $key
mixed $default

Returns

mixed

makeState()

makeState() : string|boolean

Put state to session storage and return it.

Returns

string|boolean

removeCallback()

removeCallback(string  $response) : string

Remove the fucking callback parentheses.

Parameters

string $response

Returns

string