PHP Class Webiny\Component\OAuth2\Tests\Mocks\OAuth2BridgeMock

Inheritance: extends Webiny\Component\OAuth2\Bridge\AbstractOAuth2
Exibir arquivo Open project: Webiny/Framework

Public Methods

Method Description
__construct ( string $clientId, string $clientSecret, string $redirectUri ) Base constructor.
getAccessToken ( ) : string Get access token.
getCertificate ( ) : string Returns the path to certificate.
requestAccessToken ( string $tokenUrl ) : 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.

Method Details

__construct() public method

Base constructor.
public __construct ( string $clientId, string $clientSecret, string $redirectUri )
$clientId string Client id.
$clientSecret string Client secret.
$redirectUri string Target url where to redirect after authentication.

getAccessToken() public method

Get access token.
public getAccessToken ( ) : string
return string Access token.

getCertificate() public method

Returns the path to certificate.
public getCertificate ( ) : string
return string Path to certificate.

requestAccessToken() public method

You can call this method only on the OAuth redirect_uri page or else the request will fail.
public requestAccessToken ( string $tokenUrl ) : string
$tokenUrl string Url to the page where we can get the access token.
return string Access token.

setAccessToken() public method

Set the access token.
public setAccessToken ( string $accessToken ) : void
$accessToken string Access token.
return void

setCertificate() public method

Set the certificate used by OAuth2 requests.
public setCertificate ( string $pathToCertificate ) : void
$pathToCertificate string Absolute path to the certificate file.
return void