Class Client
OAuth2 client implementation
- Maniaplanet\WebServices\HTTPClient
- Maniaplanet\WebServices\ManiaConnect\Client
Direct known subclasses
Maniaplanet\WebServices\ManiaConnect\PlayerNamespace: Maniaplanet\WebServices\ManiaConnect
Located at libraries/Maniaplanet/WebServices/ManiaConnect/Client.php
public static
|
|
public
|
#
__construct( string $username = null, string $password = null )
Default constructor. Children classes should, if they need to override it, keep the same first two parameters (the API credentials) to keep the usage of the SDK simple. |
public
string
|
#
getLoginURL( string $scope = null, string $redirectURI = null )
When a user is not authentified, you need to create a link to the URL returned by this method. |
public
string
|
#
getLogoutURL( string $redirectURI = null )
If you want to place a "logout" button, you can use this link to log the user out of the player page too. Don't forget to empty your sessions . |
public
|
|
protected
string
|
|
protected
|
#
getRequestURI( )
Since $_SERVER['REQUEST_URI'] is only available on Apache, we generate an equivalent using other environment variables. |
protected
string
|
#
getAccessToken( )
Tries to get an access token. If one is found in the session, it returns it. If a code is found in the request, it tries to exchange it for an access token on the OAuth2 Token Endpoint Else it returns false |
protected
|
#
executeOAuth2( mixed $method, mixed $ressource, array $params = array() )
Executes an request on the API with an OAuth2 access token. It works just like its parent execute() method. |
execute()
|
string |
TOKEN_PATH
|
'/oauth2/token/' |
#
Path for the OAuth2 Token Endpoint on our API |
VERSION
|
protected
string
|
$loginURL | 'https://ws.maniaplanet.com/oauth2/authorize/' |
|
protected
string
|
$logoutURL | 'https://ws.maniaplanet.com/oauth2/authorize/logout/' |
|
protected static
mixed
|
$persistance |
|
#
An implementation of the Peristance interface to store data (such as access tokens) between requests. Default implementation is using PHP session but you can easily write your own if needed. |
$APIURL,
$accept,
$contentType,
$enableAuth,
$headers,
$lastException,
$password,
$serializeCallback,
$throwExceptions,
$unserializeCallback,
$username
|