2

We are stuck with an Adobe DPS project. We cant get our DPS android app to do Entitlement for our print subscribers and we were wondering if anyone out there has managed to get this right.

We've used Adobe's tutorial here: http://www.adobe.com/devnet/digitalpublishingsuite/articles/library-store-combined-template.html, with isEntitlementViewer set to true.

The code asks for a username and password and then via Adobe's API AdobeLibraryAPI.js, it authenticates a user via our own API. the very same code is working 100% in the iPad version of the app.

The file that actually processes the login (called LoginDialog.js) contains the following code within a function called clickHandler (we’ve added a few javascript alerts to try debug the login process)

    // Login using the authenticationService.
    var transaction = adobeDPS.authenticationService.login($username.val(), $password.val());
    alert("1:  "+transaction.state ); //returns “1:    0”
    transaction.completedSignal.addOnce(function(transaction) {
            alert("2:  "+transaction.state );  //never returns
            var transactionStates = adobeDPS.transactionManager.transactionStates;
            if (transaction.state == transactionStates.FAILED) {
                    $("#login .error").html("Authentication Failed.")
            } else if (transaction.state == transactionStates.FINISHED){
                    this.$el.trigger("loginSuccess");
                    this.close();
            }
            alert("3:  "+transaction.state ); //never returns
    }, this);
    alert("4:  "+transaction.error ); //never returns

Anyone out there with some DPS/android/Entitlement experience?

StarsSky
  • 6,721
  • 6
  • 38
  • 63
Vauneen
  • 147
  • 3
  • 13
  • This code seems to be correct. Maybe is a configuration problem. Verify if the "Use legacy store APIs" is not checked on the DPS App Builder. I had strange problems in the past that I solved recreating the app, so you may try that too. – Dimas Kotvan Mar 31 '14 at 12:49

1 Answers1

0

Android Entitlement only works after an integrator ID is registered with Adobe, as the android viewers service routes are only configured via the integrator ID. If you do not have an integrator ID, you need to acquire one from Adobe Support.

Also it is worth mentioning, that in contrary to iOS, Android DPS viewers only support one base Route/URL for Authentication and Entitlements.

For Example whereas in iOS you can have the login been done via the first URL:

https://example.com/api/v1/SignInWithCredentials

The second URL for entitlements can be on a different URL:

http://server2.example.com/v1/api/entitlements

In android both URLs have to be the same, e.g.:

https://example.com/api/v1/SignInWithCredentials and https://example.com/api/v1/entitlements

Rias
  • 1,956
  • 22
  • 33