letsdeal-no / spid-client
There is no license information available for the latest version (v1.0.0) of this package.
SPiD Client
v1.0.0
2018-03-30 12:07 UTC
Requires
- guzzlehttp/guzzle: ^6.3
- predis/predis: ^1.1
Requires (Dev)
- phpspec/phpspec: ^4.3
This package is auto-updated.
Last update: 2025-04-17 22:41:40 UTC
README
This library provides a service-oriented client library for integration with SPiD
It provides:
SPiD client class
\SPiD\Client
- it utilizes Guzzle to communicate with SPiD.
It provides public methods:
post(string $url, array $formParams)
- general function to send requests with proper format recognized by SPiD without authorizationgetAuthenticated($url)
- sends GET request and utilizes Authorization service to obtain or refresh OAuth2 tokenpostAuthenticated($url, array $formParams)
- sends POST request and utilizes Authorization service to obtain or refresh OAuth2 tokenparseSignedRequest($signed_request)
- used to parse SPiD signed responses
SPiD authorization token repository
\SPiD\AuthTokenRepository
- used to get and refresh authorization tokens
It provides two public methods:
getClientAuthToken(string $scope = ''): AuthToken
- used to retrieve authorization tokenrefreshAccessToken(AuthToken $authToken): AuthToken
- used to refresh an existing token
There are currently two implementations of this interface:
\SPiD\SimpleAuthTokenRepository
- based on Guzzle\SPiD\RedisAuthTokenRepository
- based on the one above, but caching authorization token in Redis using predis library
Installation
Add Schibsted's Artifactory to your repositories list in composer.json:
"repositories": [ { "type": "composer", "url": "https://artifacts.schibsted.io/artifactory/api/composer/php-local" } ]
And run:
composer require letsdeal-no/spid-client:^1.0.0