PHP Класс Webiny\Component\OAuth2\Bridge\AbstractOAuth2

This class implements the OAuth2Interface and adds some methods that ease the implementation of OAuth2 bridge libraries.
Наследование: implements Webiny\Component\OAuth2\Bridge\OAuth2Interface, use trait Webiny\Component\StdLib\StdLibTrait
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$accessTokenName string Name of the access token.
$clientId string OAuth2 Client ID.
$clientSecret string Client secret for defined Client ID.
$redirectUri string A URI where the user will be redirected after OAuth2 authorization.
$scope string Request scope, a comma-separated list of parameters.
$state string Request state.

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

Метод Описание
getAccessTokenName ( ) : string Returns the name of access token param. Its usually either 'access_token' or 'token' based on the OAuth2 server.
getClientId ( ) : string Get client id.
getClientSecret ( ) : string Get client secret.
getRedirectURI ( ) : string Get the defined redirect URI.
getScope ( ) : string Get the defined scope.
getServerClassName ( ) : string Returns the name of current OAuth2 server class.
getState ( ) : string Get the state parameter.
setOAuth2Server ( string $serverName, null | array $options = null ) Currently supported servers are: [facebook, google, linkedin].
setScope ( string $scope ) : void Set the request scope.
setState ( string $state ) : void. Set the state parameter.

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

getAccessTokenName() публичный Метод

Returns the name of access token param. Its usually either 'access_token' or 'token' based on the OAuth2 server.
public getAccessTokenName ( ) : string
Результат string

getClientId() публичный Метод

Get client id.
public getClientId ( ) : string
Результат string Client id.

getClientSecret() публичный Метод

Get client secret.
public getClientSecret ( ) : string
Результат string Client secret.

getRedirectURI() публичный Метод

Get the defined redirect URI.
public getRedirectURI ( ) : string
Результат string Redirect URI.

getScope() публичный Метод

Get the defined scope.
public getScope ( ) : string
Результат string A comma separated list of parameters.

getServerClassName() публичный Метод

Returns the name of current OAuth2 server class.
public getServerClassName ( ) : string
Результат string

getState() публичный Метод

Get the state parameter.
public getState ( ) : string
Результат string State parameter

setOAuth2Server() публичный Метод

You can also paste 'custom' as server name, but in that case you must also provide the $options array that has auth_url and token_url as array keys. You can put variables like {CLIENT_ID}, {REDIRECT_URI}, {SCOPE} and {STATE} inside the auth_url and this function will replace them with current values.
public setOAuth2Server ( string $serverName, null | array $options = null )
$serverName string Name of the OAuth2 server for which you wish to get the auth_url and token_url.
$options null | array Optional array that you must provide in case of 'custom' server name.

setScope() публичный Метод

Set the request scope.
public setScope ( string $scope ) : void
$scope string A comma-separated list of parameters. Example: email,extender_permissions
Результат void

setState() публичный Метод

Set the state parameter.
public setState ( string $state ) : void.
$state string State name.
Результат void.

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

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

Name of the access token.
protected string $accessTokenName
Результат string

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

OAuth2 Client ID.
protected string $clientId
Результат string

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

Client secret for defined Client ID.
protected string $clientSecret
Результат string

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

A URI where the user will be redirected after OAuth2 authorization.
protected string $redirectUri
Результат string

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

Request scope, a comma-separated list of parameters.
protected string $scope
Результат string

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

Request state.
protected string $state
Результат string