PHP Класс Overtrue\Socialite\Providers\AbstractProvider

Наследование: implements Overtrue\Socialite\ProviderInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$clientId string The client ID.
$clientSecret string The client secret.
$config Overtrue\Socialite\Config The configuration.
$encodingType The type of the encoding in the query.
$parameters array The custom parameters to be sent with the request.
$redirectUrl string The redirect URL.
$request Symfony\Component\HttpFoundation\Request The HTTP request instance.
$scopeSeparator string The separating character for the requested scopes.
$scopes array The scopes being requested.
$stateless boolean Indicates if the session state should be utilized.

Открытые методы

Метод Описание
__construct ( Request $request, Config $config, string $clientId, string $clientSecret, string | null $redirectUrl = null ) Create a new provider instance.
getAccessToken ( string $code ) : AccessToken Get the access token for the given code.
getRedirectUrl ( ) : string Return the redirect url.
getRequest ( ) : Request Get the request instance.
redirect ( string $redirectUrl = null ) : RedirectResponse Redirect the user of the application to the provider's authentication screen.
scopes ( array $scopes ) Set the scopes of the requested access.
setRedirectUrl ( string $redirectUrl ) Set redirect url.
setRequest ( Request $request ) Set the request instance.
stateless ( ) Indicates that the provider should operate as stateless.
user ( Overtrue\Socialite\AccessTokenInterface $token = null )
with ( array $parameters ) Set the custom parameters of the request.
withRedirectUrl ( string $redirectUrl ) Set redirect url.

Защищенные методы

Метод Описание
arrayItem ( array $array, string $key, mixed $default = null ) : mixed Return array item by key.
buildAuthUrlFromBase ( string $url, string $state ) : string Get the authentication URL for the provider.
formatScopes ( array $scopes, string $scopeSeparator ) : string Format the given scopes.
getAuthUrl ( string $state ) : string Get the authentication URL for the provider.
getCode ( ) : string Get the code from the request.
getCodeFields ( string | null $state = null ) : array Get the GET parameters for the code request.
getHttpClient ( ) : Client Get a fresh instance of the Guzzle HTTP client.
getTokenFields ( string $code ) : array Get the POST fields for the token request.
getTokenUrl ( ) : string Get the token URL for the provider.
getUserByToken ( Overtrue\Socialite\AccessTokenInterface $token ) : array Get the raw user for the given access token.
hasInvalidState ( ) : boolean Determine if the current request / session has a mismatching "state".
isStateless ( ) : boolean Determine if the provider is operating as stateless.
mapUserToObject ( array $user ) : Overtrue\Socialite\User Map the raw user array to a Socialite User instance.
parseAccessToken ( Psr\Http\Message\StreamInterface | array $body ) : AccessToken Get the access token from the token response body.
usesState ( ) : boolean Determine if the provider is operating with state.

Описание методов

__construct() публичный метод

Create a new provider instance.
public __construct ( Request $request, Config $config, string $clientId, string $clientSecret, string | null $redirectUrl = null )
$request Symfony\Component\HttpFoundation\Request
$config Overtrue\Socialite\Config
$clientId string
$clientSecret string
$redirectUrl string | null

arrayItem() защищенный метод

Return array item by key.
protected arrayItem ( array $array, string $key, mixed $default = null ) : mixed
$array array
$key string
$default mixed
Результат mixed

buildAuthUrlFromBase() защищенный метод

Get the authentication URL for the provider.
protected buildAuthUrlFromBase ( string $url, string $state ) : string
$url string
$state string
Результат string

formatScopes() защищенный метод

Format the given scopes.
protected formatScopes ( array $scopes, string $scopeSeparator ) : string
$scopes array
$scopeSeparator string
Результат string

getAccessToken() публичный метод

Get the access token for the given code.
public getAccessToken ( string $code ) : AccessToken
$code string
Результат Overtrue\Socialite\AccessToken

getAuthUrl() абстрактный защищенный метод

Get the authentication URL for the provider.
abstract protected getAuthUrl ( string $state ) : string
$state string
Результат string

getCode() защищенный метод

Get the code from the request.
protected getCode ( ) : string
Результат string

getCodeFields() защищенный метод

Get the GET parameters for the code request.
protected getCodeFields ( string | null $state = null ) : array
$state string | null
Результат array

getHttpClient() защищенный метод

Get a fresh instance of the Guzzle HTTP client.
protected getHttpClient ( ) : Client
Результат GuzzleHttp\Client

getRedirectUrl() публичный метод

Return the redirect url.
public getRedirectUrl ( ) : string
Результат string

getRequest() публичный метод

Get the request instance.
public getRequest ( ) : Request
Результат Symfony\Component\HttpFoundation\Request

getTokenFields() защищенный метод

Get the POST fields for the token request.
protected getTokenFields ( string $code ) : array
$code string
Результат array

getTokenUrl() абстрактный защищенный метод

Get the token URL for the provider.
abstract protected getTokenUrl ( ) : string
Результат string

getUserByToken() абстрактный защищенный метод

Get the raw user for the given access token.
abstract protected getUserByToken ( Overtrue\Socialite\AccessTokenInterface $token ) : array
$token Overtrue\Socialite\AccessTokenInterface
Результат array

hasInvalidState() защищенный метод

Determine if the current request / session has a mismatching "state".
protected hasInvalidState ( ) : boolean
Результат boolean

isStateless() защищенный метод

Determine if the provider is operating as stateless.
protected isStateless ( ) : boolean
Результат boolean

mapUserToObject() абстрактный защищенный метод

Map the raw user array to a Socialite User instance.
abstract protected mapUserToObject ( array $user ) : Overtrue\Socialite\User
$user array
Результат Overtrue\Socialite\User

parseAccessToken() защищенный метод

Get the access token from the token response body.
protected parseAccessToken ( Psr\Http\Message\StreamInterface | array $body ) : AccessToken
$body Psr\Http\Message\StreamInterface | array
Результат Overtrue\Socialite\AccessToken

redirect() публичный метод

Redirect the user of the application to the provider's authentication screen.
public redirect ( string $redirectUrl = null ) : RedirectResponse
$redirectUrl string
Результат Symfony\Component\HttpFoundation\RedirectResponse

scopes() публичный метод

Set the scopes of the requested access.
public scopes ( array $scopes )
$scopes array

setRedirectUrl() публичный метод

Set redirect url.
public setRedirectUrl ( string $redirectUrl )
$redirectUrl string

setRequest() публичный метод

Set the request instance.
public setRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

stateless() публичный метод

Indicates that the provider should operate as stateless.
public stateless ( )

user() публичный метод

public user ( Overtrue\Socialite\AccessTokenInterface $token = null )
$token Overtrue\Socialite\AccessTokenInterface

usesState() защищенный метод

Determine if the provider is operating with state.
protected usesState ( ) : boolean
Результат boolean

with() публичный метод

Set the custom parameters of the request.
public with ( array $parameters )
$parameters array

withRedirectUrl() публичный метод

Set redirect url.
public withRedirectUrl ( string $redirectUrl )
$redirectUrl string

Описание свойств

$clientId защищенное свойство

The client ID.
protected string $clientId
Результат string

$clientSecret защищенное свойство

The client secret.
protected string $clientSecret
Результат string

$config защищенное свойство

The configuration.
protected Config,Overtrue\Socialite $config
Результат Overtrue\Socialite\Config

$encodingType защищенное свойство

The type of the encoding in the query.
protected $encodingType

$parameters защищенное свойство

The custom parameters to be sent with the request.
protected array $parameters
Результат array

$redirectUrl защищенное свойство

The redirect URL.
protected string $redirectUrl
Результат string

$request защищенное свойство

The HTTP request instance.
protected Request,Symfony\Component\HttpFoundation $request
Результат Symfony\Component\HttpFoundation\Request

$scopeSeparator защищенное свойство

The separating character for the requested scopes.
protected string $scopeSeparator
Результат string

$scopes защищенное свойство

The scopes being requested.
protected array $scopes
Результат array

$stateless защищенное свойство

Indicates if the session state should be utilized.
protected bool $stateless
Результат boolean