$testServer
$testServer : \OCLC\Auth\binary
Whether or not the application is interacting with a test server
A class that represents a clients OCLC Web Service Key.
The WSKey has a key and secret and has access to one or more OCLC Web Services. Optionally, it can include principal information in the form of a principal ID and IDNS that represent an user and a redirect URI to be used in the OAuth 2 login flows. The WSKey class is used to
__construct(string $key, string $secret, array $options = null)
Construct a new Web Service key for use when authenticating to OCLC Web Services.
string | $key | the hashed string that represents your API key |
string | $secret | a string which is the secret used when generating digital signatures |
array | $options | an array of three possible name/value pairs
|
getLoginURL(integer $authenticating_institution_id = null, integer $context_institution_id = null) : string
Return the login URL used with OCLC's OAuth 2 implementation of the Explicit Authorization Flow.
integer | $authenticating_institution_id | |
integer | $context_institution_id |
The Login URL used with OCLC's OAuth 2 implementation of the Explicit Authorization Flow
getAccessTokenWithAuthCode(string $authCode, integer $authenticatingInstitutionId, integer $contextInstitutionId) : \OCLC\Auth\OCLC/Auth/AccessToken
Returns an OCLC/Auth/AccessToken object
string | $authCode | authorization code returned as a query parameter |
integer | $authenticatingInstitutionId | the WorldCat Registry ID of the institution that will login the user |
integer | $contextInstitutionId | the WorldCat Registry ID of the institution whose data will be accessed |
Returns an /OCLC/Auth/AccessToken object when given
getAccessTokenWithClientCredentials(integer $authenticatingInstitutionId, integer $contextInstitutionId, \OCLC\Auth\OCLC/User $user = null) : \OCLC\Auth\OCLC/Auth/AccessToken
Returns an OCLC/Auth/AccessToken object
integer | $authenticatingInstitutionId | the WorldCat Registry ID of the institution that will login the user |
integer | $contextInstitutionId | the WorldCat Registry ID of the institution whose data will be accessed |
\OCLC\Auth\OCLC/User | $user | an /OCLC/User object which contains a valid principalID, principalIDNS and insitution ID for a user |
Returns an /OCLC/Auth/AccessToken object when given
getHMACSignature(string $method, string $request_url, array $options = null) : string
Generates a digital signature for a given request according to the OAuth HMAC specification
string | $method | the HTTP method, GET, POST, PUT, DELETE |
string | $request_url | the URL the request will be made to |
array | $options |
|
The HMAC Signature that should be sent in the Authorization Header
signRequest(string $key, string $secret, string $method, string $request_url, string $bodyHash, string $timestamp, string $nonce) : string
Create a Signature for a request using
string | $key | |
string | $secret | |
string | $method | |
string | $request_url | |
string | $bodyHash | |
string | $timestamp | |
string | $nonce |
normalizeRequest(string $key, string $method, string $request_url, string $bodyHash, string $timestamp, string $nonce) : string
Normalize the Request by breaking apart the URL
string | $key | |
string | $method | |
string | $request_url | |
string | $bodyHash | |
string | $timestamp | |
string | $nonce |