Specifies a client that provides service to run command at api server This client can get self credentials, and save in store. This version do not encrypted credentials.

package Ant\ChateaClient\Service\Client
see
see
see
see
see

 Methods

Build new class ChateaOAuth2Client, this provides commands to run at ApiChateaServer This client can get self credentials, and save in store. This version do not encrypted credentials.

factory(array $config) : \Ant\ChateaClient\Service\Client\ChateaGratisAppClient | \Guzzle\Service\Client
Static

Parameters

$config

array

Associative array can configure the client. The parameters are: client_id The public key of client. This parameter is required secret The private key of client. This parameter is required base_url The server endpoind url. This parameter is optional Accept The accept header, default value is json. This parameter is optional environment Set mode production [prod] or developing [dev] default value is prod. This parameter is optional scheme Set server schema communication [http|https] for default https. This parameter is optional subdomain Set server subdomain if this exist. For default is api. This parameter is optional store Set where save server credentials

Returns

Prepare a command for sending and get the RequestInterface object created by the command

prepareCommand(\Guzzle\Service\Command\CommandInterface $command) : \Ant\ChateaClient\Service\Client\RequestInterface

Disable the service credentials as well as the session.

revokeToken() : string

Exceptions

\Ant\ChateaClient\Service\Client\AuthenticationException This exception is thrown if you do not credentials or you cannot use this method

Returns

stringMessage sucessfully if can revoke token | Message with error in json format

Update the access token on header.

updateAccessToken(string $access_token) 

Parameters

$access_token

string

The token you put in header

This retrieve the access token in store or in server

prepareAccessToken() : string

Returns

stringthe access token

 Properties

 

this save data on store

$store : \Ant\ChateaClient\Service\Client\StoreInterface