PHP Class Larabros\Elogram\Helpers\RedirectLoginHelper

Show file Open project: larabros/elogram

Protected Properties

Property Type Description
$provider Larabros\Elogram\Http\OAuth2\Providers\AdapterInterface
$store Larabros\Elogram\Http\Sessions\DataStoreInterface

Public Methods

Method Description
__construct ( Larabros\Elogram\Http\OAuth2\Providers\AdapterInterface $provider, Larabros\Elogram\Http\Sessions\DataStoreInterface $store ) Creates an instance of :php:class:RedirectLoginHelper.
getAccessToken ( string $code, string $grant = 'authorization_code' ) : League\OAuth2\Client\Token\AccessToken Validates CSRF and returns the access token.
getLoginUrl ( array $options = [] ) : string Sets CSRF value and returns the login URL.

Protected Methods

Method Description
getInput ( string $key ) : string | null Retrieves and returns a value from a GET param.
validateCsrf ( ) Validates any CSRF parameters.

Method Details

__construct() public method

Creates an instance of :php:class:RedirectLoginHelper.
public __construct ( Larabros\Elogram\Http\OAuth2\Providers\AdapterInterface $provider, Larabros\Elogram\Http\Sessions\DataStoreInterface $store )
$provider Larabros\Elogram\Http\OAuth2\Providers\AdapterInterface
$store Larabros\Elogram\Http\Sessions\DataStoreInterface

getAccessToken() public method

Validates CSRF and returns the access token.
See also: League\OAuth2\Client\Provider\AbstractProvider::getAccessToken()
public getAccessToken ( string $code, string $grant = 'authorization_code' ) : League\OAuth2\Client\Token\AccessToken
$code string
$grant string
return League\OAuth2\Client\Token\AccessToken

getInput() protected method

Retrieves and returns a value from a GET param.
protected getInput ( string $key ) : string | null
$key string
return string | null

getLoginUrl() public method

Sets CSRF value and returns the login URL.
See also: League\OAuth2\Client\Provider\AbstractProvider::getAuthorizationUrl()
public getLoginUrl ( array $options = [] ) : string
$options array
return string

validateCsrf() protected method

Validates any CSRF parameters.
protected validateCsrf ( )

Property Details

$provider protected property

protected AdapterInterface,Larabros\Elogram\Http\OAuth2\Providers $provider
return Larabros\Elogram\Http\OAuth2\Providers\AdapterInterface

$store protected property

protected DataStoreInterface,Larabros\Elogram\Http\Sessions $store
return Larabros\Elogram\Http\Sessions\DataStoreInterface