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

This component is used for communication with OAuth2 servers like Facebook Graph API.
Наследование: use trait Webiny\Component\StdLib\ComponentTrait
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( AbstractOAuth2 $instance ) Base constructor.
getAccessToken ( ) : string Get access token.
getAccessTokenName ( ) : string Returns the name of access token param. Its usually either 'access_token' or 'token' based on the OAuth2 server.
getAuthenticationUrl ( ) : string Returns the authentication url.
getCertificate ( ) : string Returns the path to certificate.
getClientId ( ) : string Get client id.
getClientSecret ( ) : string Get client secret.
getRedirectURI ( ) : string Get the defined redirect URI.
getScope ( ) : string Get the defined scope.
getState ( ) : string Get the state parameter.
request ( ) : AbstractServer
requestAccessToken ( ) : string Requests the access token from the OAuth server.
setAccessToken ( string $accessToken ) : void Set the access token.
setCertificate ( string $pathToCertificate ) : void Set the certificate used by OAuth2 requests.
setScope ( string $scope ) : void Set the request scope.
setState ( string $state ) : void. Set the state parameter.

Приватные методы

Метод Описание
processUrl ( string $url ) : string Replaces the url variables with real data.

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

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

NOTE: Use OAuth2Loader::getInstance method to get an OAuth2 instance.
public __construct ( AbstractOAuth2 $instance )
$instance Webiny\Component\OAuth2\Bridge\AbstractOAuth2

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

Get access token.
public getAccessToken ( ) : string
Результат string Access token.

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

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

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

Returns the authentication url.
public getAuthenticationUrl ( ) : string
Результат string Authentication url

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

Returns the path to certificate.
public getCertificate ( ) : string
Результат string Path to certificate.

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.

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

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

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

public request ( ) : AbstractServer
Результат AbstractServer

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

You can call this method only on the OAuth redirect_uri page or else the request will fail.
public requestAccessToken ( ) : string
Результат string Access token.

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

Set the access token.
public setAccessToken ( string $accessToken ) : void
$accessToken string Access token.
Результат void

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

Set the certificate used by OAuth2 requests.
public setCertificate ( string $pathToCertificate ) : void
$pathToCertificate string Absolute path to the certificate file.
Результат void

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.