Constants

TOKEN_DIRECTORY

TOKEN_DIRECTORY

Directory of the token file

GRANT_TYPE

GRANT_TYPE

Grant type

QUERY_URL

QUERY_URL

OAuth query URL

Properties

$str_application_scope

$str_application_scope : String

The application scope

Type

String

$str_client_id

$str_client_id : String

Client ID from your application in Azure DataMarket

Type

String

$str_client_secret

$str_client_secret : String

Client Secret from your application in Azure DataMarket

Type

String

$str_token_file

$str_token_file : String

The file where the token is stored

Type

String

Methods

__construct()

__construct(String  $str_client_id, String  $str_client_secret,   $str_application_scope) 

Both arguments are required for ANY operation, which is why they are in the constructor.

Parameters

String $str_client_id
String $str_client_secret
$str_application_scope

get_token()

get_token() : String

Retrieve the OAuth token to be used in Microsoft Datamarket Applications

Returns

String

token_has_expired()

token_has_expired() : Boolean

Has the token expired?

Returns

Boolean

request_new_token()

request_new_token() : String

Gets a new token, stores and returns it

Returns

String

read_token_file()

read_token_file() : String

Reads the token file.

Forces a re-read using clearstatcache for thread safety

Returns

String

store_token_response()

store_token_response(\StdClass  $obj_response) 

Stores the token and expiry time as a json encoded string

Parameters

\StdClass $obj_response

get_current_token_data()

get_current_token_data() : String

Gets the token from the current file

Returns

String

get_current_expiry()

get_current_expiry() : String

Gets the expiry time from the current file

Returns

String