Announcing Release of OCLC Auth PHP Library

 

We are happy to announce the v1.0 release of the OCLC Auth PHP library via Github. This code library is the third implementation that the OCLC Developer Network is releasing to assist developers working with our web services protected by our API key system.

Implementations of this functionality currently exist in three different languages:

We're working on implementations in Java and Python to be released a little later. Additionally, Terry Reese has written the same functionality in C# and you can dig into Terry’s code on Github to see his implementation.

This PHP library can be cloned or checked out from OCLC Developer Network repository and installed by users of OCLC Web Service Keys, or WSKeys. Once installed, your PHP application can construct an OCLC\Auth\WSKey object using your API key and secret. This class can then be used to:

  • sign requests using our HMAC Signature pattern
  • obtain an Access Token using our OAuth 2 and access token pattern
    • determine the HTTP redirect Location to log a user in
    • obtain an Access Token using an Authorization code
  • refresh an expired Access Token
  • obtain user identifiers for a logged in user
  • use as a reference implementation to write your own

Directions for two installation methods (phar, zip) are included in the README.  We've provided usage examples for HMAC, and Explicit Authorization Code flow. Additionally, we're working on making the library installable via Composer and will update the README with those instructions and add a new item to Developer Network when that work is complete. Please let us know what you think or if you encounter any issues by sending us an email.

To learn more about WSKey, check out the recording of our workshop Web Service Keys for APIs

UPDATE: We've added instructions for installing via Composer to the README file. So developers who use this tool for dependency management can install it this way.

 

  • Karen Coombs

    Karen Coombs

    Senior Product Analyst

We are a worldwide library cooperative, owned, governed and sustained by members since 1967. Our public purpose is a statement of commitment to each other—that we will work together to improve access to the information held in libraries around the globe, and find ways to reduce costs for libraries through collaboration. Learn more »