Hi, my name is Carl and I am a Software Engineer on the Google Chrome team. In this video,
I will describe how to integrate with the Chrome Web Store Licensing API.
Suppose you are creating a web app. The Chrome Web Store makes it easy to charge people to
use that app wherever it is running. Users will purchase access to your app right from
the Chrome Web Store. To check whether a user has paid for your app, use the Chrome Web
Store’s licensing API. The licensing API takes two inputs: the app
ID and the user ID. The app ID is the id the Chrome Web Store
assigns to your app when you first create it in the store.
The user ID is the Google-provided OpenID URL. Typically, with OpenID the user ID is
not shared unless the user explicitly grants permission to the application; however, Google
Chrome grants this permission automatically when the user installs the application. Users
in other browsers will still see an approval step.
A number of OpenID libraries may be used to determine the OpenID URL.
To see a comprehensive list of libraries just visit http://wiki.openid.net/Libraries.
Some specific OpenID libraries you can explore are the following:
For Java you can try OpenID4Java. For Python try using Google App Engine’s
Django OpenID. You can find more information on how to use
OpenID in our documentation. The Chrome Web Store doesn’t allow just
anyone to call the licensing API. The store will check that the caller is authorized to
make a licensing API check for a given app. In this way we provide separation among the
licensing data for various apps. The developer that creates a web app in the
Chrome Web Store is the only user with permission to call the licencing API for that app.
In order to securely authenticate the owner of an application, we use OAuth access tokens.
These tokens prove that you have the right to call the API.
We automatically provide you with an OAuth access token in the developer dashboard for
each app you own. An OAuth access token is really a token and a token secret, but I just
refer to them as an access token. To create a token, go to the developer dashboard
and follow the link labeled “AuthToken”. The next page explains what you need the token
for and at the bottom of the page, you will see a button to generate the OAuth access
token. When you click that button you will see the
values for oauth_token and oauth_token_secret fill in.
Those tokens are scoped so they will only work to access the Chrome Web Store licensing
API and cannot be used to access other information from Google.
Please note that the Chrome Web Store will not display these values more than one time
for security reasons, so, don’t forget to copy them to a secure location before you
leave the page. If necessary, you can return later to generate a new access token.
Now you should have all the data you need to call the licensing API:
An OAuth access token A User ID
and an App ID. Let’s look at the details of calling the
API using HTTP. The licensing API endpoint is simply a URL
containing the app ID and the user ID. The app and user IDs must be URL-encoded.
To call the licensing API, you need to add OAuth signature parameters. You can use an
OAuth library to sign the HTTP requests. Visit http://code.google.com/apis/gdata/docs/client-libraries.html
for a list of libraries that may be used to perform these API calls in various web development
languages. The signing step needs the following pieces
of data: The consumer key: This is always “anonymous”.
The consumer secret: This is also always “anonymous”. The token and the token secret.
The consumer key and consumer secret are anonymous because you, the developer, are granting access
to the application you own. JSON is the default response format for API
requests. This response will indicate whether the user should be granted permission to use
your app. If you prefer the ATOM format, you can specify
alt=atom in the URL. To learn more about the Chrome Web Store and
how to integrate with our licensing API, just visit code.google.com/chrome/webstore.