Download the PHP package researchpanelasia/sopx-auth-v1_1 without Composer
On this page you can find all versions of the php package researchpanelasia/sopx-auth-v1_1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download researchpanelasia/sopx-auth-v1_1
More information about researchpanelasia/sopx-auth-v1_1
Files in researchpanelasia/sopx-auth-v1_1
Download researchpanelasia/sopx-auth-v1_1
More information about researchpanelasia/sopx-auth-v1_1
Files in researchpanelasia/sopx-auth-v1_1
Vendor researchpanelasia
Package sopx-auth-v1_1
Short Description SOP v1.1 authentication
License MIT
Homepage https://github.com/researchpanelasia/php-sopx-auth-v1_1
Package sopx-auth-v1_1
Short Description SOP v1.1 authentication
License MIT
Homepage https://github.com/researchpanelasia/php-sopx-auth-v1_1
Keywords Authenticationsop
Please rate this library. Is it a good library?
Informations about the package sopx-auth-v1_1
NAME
SOPx_Auth_V1_1 - SOP v1.1 authentication module
SYNOPSIS
$auth = new \SOPx\Auth\V1_1\Client('<APP_ID>', '<APP_SECRET>');
$request = $auth->createRequest(
'GET', 'https://<API_HOST>/path/to/endpoint',
array('app_id' => '<APP_ID>', 'app_mid' => '<APP_MID>', ... )
);
//=> isa GuzzleHttp\Psr7\Request object
OR
$sig = \SOPx\Auth\V1_1\Util::createSignature(
array(
'app_id' => '<APP_ID>',
'app_mid' => '<APP_MID>',
'time' => $time,
...
), '<APP_SECRET>'
);
//=> HMAC SHA256 hash signature
DESCRIPTION
This module enables you to generate SOP v1.1 signature, make HTTP request to SOP v1.1 API.
HOW TO USE
Making a valid request to SOP API endpoint
$auth = new \SOPx\Auth\V1_1\Client('<APP_ID>', '<APP_SECRET>');
$request = $auth->createRequest(
'GET',
'https://<API_HOST>/path/to/endpoint',
array(
'param1' => 'foo',
'param2' => 'bar',
...
)
);
// Then use Guzzle HTTP client to send request
Creating a valid URL (e.g., for JSONP request)
$auth = new \SOPx\Auth\V1_1\Client('<APP_ID>', '<APP_SECRET>');
$request = $auth->createRequest(
'GET',
'https://<API_HOST>/path/to/jsonp/endpoint',
array(
'param1' => 'foo',
'param2' => 'bar',
...
)
);
// Then maybe in your HTML template:
<script src=""></script>
Sending various request types
GET
$request = $auth->createRequest('GET', (string) $url, (array) $params)
POST
For type application/x-www-form-urlencoded
$request = $auth->createRequest('POST', (string) $url, (array) $params)
For type application/json
DELETE
PUT
For type application/x-www-form-urlencoded
$request = $auth->createRequest('PUT', (string) $url, (array) $params)
For type application/json
Verifying a request signature for validity
$auth = new \SOPx\Auth\V1_1\Client('<APP_ID>', '<APP_SECRET>');
$sig = $params['sig'];
unset($params['sig']);
if ($auth->verifySignature($sig, $params)) {
// Request is valid
}
else {
// Request is invalid
}
request types defined in SOP v1.1 Authentication.
All versions of sopx-auth-v1_1 with dependencies
PHP Build Version
Package Version
The package researchpanelasia/sopx-auth-v1_1 contains the following files
Loading the files please wait ....