Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Digital publishing /

Direct entitlement starter kit

by Scott Dreier

Scott Dreier

Content

  • Installation and configuration
  • Usage
  • What about AuthTokens?
  • What now?
  • Where to go from here

Created

2 April 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
content management customization design digital publishing Digital Publishing Suite

Requirements

Prerequisite knowledge

This article assumes you have access to and can deploy to a web server such as Apache that you have configured to run with PHP and MySQL. Readers should also be familiar with creating and publishing content to Adobe® Digital Publishing Suite (DPS) applications and using Viewer Builder to create custom DPS viewer applications.

 

Additional required other products

  • Web server, such as Apache HTTP Server
  • PHP module or CGI processor
  • MySQL Community Server (or better)
  • Sequel Pro

User level

All

Required products

  • Digital Publishing Suite, Enterprise Edition

Sample files

  • entitlement_starter_kit.zip

Note: If you have questions about this article, use the comments feature at the bottom of the article. Please don’t contact technical support with questions about Adobe Developer Connection articles.

This article introduces a kit for getting started with Adobe Digital Publishing Suite direct entitlement. The kit provides an implementation for all of the required services along with a lightweight MySQL database. The kit is based on PHP and MySQL.

The purpose of this starter kit is to showcase a concrete example implementation that illustrates the basic interface and requirements. Production usage would require you to make significant modifications to connect to distributed subscription databases and services.

Installation and configuration

There are three configurations required to enable the entitlements starter kit.

  • You need to deploy the server portion of the web application to a location that you control.
  • You need to create a DPS viewer that can connect to it.
  • You need to publish some Public+Retail folio data.

Below is a step-by-step guide.

Deploy the web application

The following is a general guide to deployment. The kit has been developed and deployed on Apache running on both OSX (Lion) and Linux.

  1. Download and extract the distribution from the ZIP file you downloaded in the Requirements section.
  2. Create a context root on the web server you plan to deploy on.
  3. Modify the settings.php file as follows:
    1. Enter the connection information (hostname, username, and password) for your MySQL instance. If you are running the MySQL instance on the same machine as your Apache server, you may be able to connect through localhost.
  4. Create a MySQL database entry
    1. Create a database named entitlements.
    2. Later on, I will explain how to create the table dynamically.
  5. Deploy the web application.

Now that you have the application, you need to create a database. To make this easy, the starter kit provides a PHP script to create the database. Use the following steps to create the database with the PHP script:

  1. Open a browser and navigate to:
http://<yourservername>[:<port>]/<contextroot>/db/initdb.php

where:

  • <yourservername> is the IP or common name of the your server (for example "lighthouse.adobe.com).
  • <port> is optional. If you're unsure of your server port, you probably don't need this setting; delete it out of your URI.
  • <contextroot> is the value created in step #2 above. On Apache, it can be the directory where you extracted your files to; this assumes that the web server's documents folder is a parent. For example: http://lighthouse.adobe.com/dps/entitlement_starter/db/initdb.php.
  1. Once you have run the script, the page displays a message: "Successfully created table: subscriptions".

Configure an application with Viewer Builder

You will need an entitlement-enabled application to use the starter kit. The starter kit comes with an entitlement "banner" that you can use. Within Viewer Builder, use the following settings:

Property

Value

Viewer Type

Multi-issue with Entitlement

Service URL

http://<yourservername>[:<port>]/contextroot/api/

(For example: http://lighthouse.adobe.com/dps/entitlement_starter/api/)

Service Auth URL

Enter the same information as you used for "Service URL" above.

Integrator ID

You will need to get this from your Adobe representative. For now, use "starter kit" as a stand-in property value. You use the Integrator ID to call verifyEntitlement, which you invoke when attempting to download an entitled folio.

Create Account URL

http://<yourservername>[:<port>]/<contextroot>/forms/createAccount.html

Forgot Password URL

http://<yourservername>[:<port>]/<contextroot>/forms/forgotPassword.html

Banner Page URL

http://<yourservername>[:<port>]/<contextroot>/banner

Offline Banner Assets

Use the file chooser to select the Archive.zip contained within the "banner" directory of the distribution.

Configure your Folio Data

When properly configured, the starter kit entitles all Public/Retail folios published after a subscriber's subscription starts. It is not necessary to publish any specific number of folios, but you will want enough to make it interesting. My suggestion is to publish at least three folios. You also need to make these available for in-app purchase. To do so, configure the in-app purchase product IDs within iTunesConnect. If you are working with a development viewer, connect to iTunesConnect through the sandbox. Within iTunesConnect, set your IAPs to the Waiting for screenshot option, in order to have them available through the sandbox. (For further information on configuring in-app purchases, see the iPad Publishing Companion Guide available from the DPS Dashboard.)

When configuring this option, select a publish time for one of your folios to be a week (or so) from today's date, so it is properly entitled.

OK…one more thing

As mentioned above, the starter kit attempt to access your DPS Fulfillment account to entitle content. Thus, it needs to know the account number. Set the variable $fulfillment_account in the settings.php file to this value. (For more information, see the Custom Storefront article on how to find this information.)

A note about mod_rewrite

I have implemented the API implementations using PHP and they have PHP file extensions. However, Adobe DPS-based viewers will invoke these endpoints without the PHP extension (for example, they will invoke SignInWithCredentials, not SignInWithCredentials.php). These are remapped using mod_rewrite logic embodied in the .htaccess file.

Usage

Now that you have downloaded, configured, and deployed everything, we can attempt to exercise the system. Once you have set up everything properly, you will see all of your folios marked as "Buy" with a price associated. For the below example, I've published three folios to my DPS account.

Figure 1: Custom DPS Viewer app showing three published folios.
Figure 1: Custom DPS Viewer app showing three published folios.

Creating an account

For a subscriber to be entitled to retail content, they must be provisioned for access. For a traditional print publication, this step usually involves looking up the subscriber's account information from a preexisting database and provisioning that account for digital access. For our starter kit, we will allow anyone to sign up. By default, the createAccount link creates a two-month subscription, which you can easily change.

You can create an account within the starter kit by creating an account from the sign-in dialog box of the viewer (see Figure 2) or by using the createAccount.html page from the starter kit deployment (see below).

Figure 2: Creating an account from the Sign In dialog box of the custom viewer
Figure 2: Creating an account from the Sign In dialog box of the custom viewer

To create an account using the createAccount.html page, navigate your browser (desktop or device) to:

http://<yourservername>[:<port>]/<contextroot>/forms/createAccount.html

(for instance, http://lighthouse.adobe.com/dps/entitlement_starter/forms/createAccount.html)

When navigating to the createAccount HTML page, you will see the following form:

Figure 3: The createAccount.html form
Figure 3: The createAccount.html form

Our sample form performs minimal data validation. It only checks that the password entries match. In a production system, you should typically validate the e-mail address by sending an e-mail against a known database entry.

Entitling content

The starter kit queries the fulfillment account (as specified in settings.php) for a list of retail+public content and then entitles any content published from the creation of the subscription account, plus one month (specifically, 31 days from creation). So, for a user created on 27-March-2012, DPS entitles anything with a publish date after 27-March-2012 to 27-April-2012. Figure 4 shows that Folio 3 has a publication date of 28-Mar-2012, but Folio1 and Folio2 are 5-Mar and 6-Mar, respectively.

Figure 4: Folio Producer Organizer shows three folios with different publication dates
Figure 4: Folio Producer Organizer shows three folios with different publication dates

Thus, only Folio 3 is entitled for our new user after he/she signs in.

Figure 5: The custom viewer app showing Folio 3, the only folio entitled for this user
Figure 5: The custom viewer app showing Folio 3, the only folio entitled for this user

What about AuthTokens?

The authentication system generates AuthToken, an opaque piece of data, in response to calls to SignInWithCredentials and RenewAuthToken. The DPS application viewer does nothing with the AuthToken data other than persist it and attach it to subsequent calls to verifyEntitlement and entitlements.

From a publisher's perspective, you can use the AuthToken as a key to look up a specific user and ideally, a specific user's session on a specific device. For the purpose of the starter kit, we create AuthTokens as a MD5 hash of the user's emailAddress. You can find this function in settings.php.

In our example, the AuthToken is not bound to a specific session. Instead, we have chosen to test the device ID (UUID) against a list of device IDs. We have arbitrarily chosen to allow you to use a single user account on up to five different devices. This allows someone with a few devices to use the same account across all of them.

How you choose to create AuthTokens is up to you. The only requirement is that your systems must be able to look up entitlements for a specific user based on it.

What now?

At this point you should have a very basic entitlement system working. To take it to the next step, consider the following:

Entitlement banner

The entitlement banner provides messaging to:

  • Entitlement-based subscribers
  • Apple AppStore subscribers
  • Non (prospective) subscribers

As such, consider different messages for these groups. Using the JavaScript Viewer API for DPS, you can interface to information within the viewer about the user's authentication state ( getUserInfo ), subscription data ( getSubscriptionData ) and entitlements ( getEntitledProducts ).

Also, you might need to modify the entitlement banner to adjust to rotation. The provided implementation uses CSS Media Queries.

Integrator ID

Adobe's fulfillment server invokes the verifyEntitlement API method. The fulfillment server uses the integrator ID, which knows where to call your services. You must provide a publicly addressable URL to verifyEntitlement to your Adobe representative in order to have this set up.

Note: Until Adobe sets up your integrator ID and deploys it, you will be unable to download any entitled content within your application.

Where to go from here

To deploy a fully functional entitlement system, you must have Adobe define and deploy an integrator ID. It is also recommended to review these related articles:

  • Leveraging direct entitlement with Digital Publishing Suite
  • Building a custom storefront with Digital Publishing Suite

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Add note-taking functionality to a folio
  • Digital Publishing Suite overview
  • Digital Publishing Suite: Three editions
  • Digital Publishing Suite hands-on tutorial
  • Enabling promotional entitlement with Digital Publishing Suite
  • Using XML to automate production of digital publications
  • Custom storefront hands-on tutorial
  • Integrate publishing workflows and editorial systems with DPS
  • Enhance your DPS folios with HTML animations using Adobe Edge
  • Integrated social sharing with Digital Publishing Suite

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement