App login

3D Issue apps can have an advanced login feature enabled that allows the app to communicate with your existing user authentication system.

This functionality requires the development of a restful endpoint on the customer’s system following the specification described below.

Once the endpoint has been implemented the 3D Issue team will integrated it with your app source.

App Login features and capabilities

  • Secure the entire app with user login. Protecting all content including plain text articles and flipbooks.
  • Works with Standard & Parent apps.
  • Customisable login page
  • Automatically drill down parent app menus based on users. Read more below

Web service specification

  • The web service can be developed in any language.
  • The web service must be available over HTTPS using TLS 1.2 with perfect forward secrecy.
    This requirement must be met for authentication to work on Apple devices. You can test your web server’s SSL configuration using Qualys SSL Labs.
  • The web service should accept the appropriate content-type headers for JSON (application/json). Returning the text/html mime type with JSON content will cause the authentication to fail.

Request

The authentication endpoint can be available at any address you wish to use.

Request

Request Method: POST
Content-Type: application/json
Accepts: application/json

Body Example:

{
"username":"anyvalidstring",
"password":"unmodifiedpassword"
}

Success Response Example:

Response Code 200

{
"success":true (optional if returning token),
"token":"(optional) user auth token (any user safe string)",
"url":"(optional) String matching a parent menu for automatic content drill down"
}

Fail response Example:

Response Code 401

{
"success":false,
"message":"(Optional) Failure reason, eg: Invalid Credentials"
}

Static File authentication

If self hosting your Flipbooks the app can send the optional request token sent from your endpoint with every request to your server, providing a means to authenticate every request.

The token string will be sent using a parameter in each request. For example;

https://yourdomain.com/flipbooks/issue1/index.html?t=yourusertoken

Parent app Menu drilldown

Returning the url value in your login response allows the app to customise the initial menu location the user is presented with after logging in. This functionality is only available to Parent apps.

This works by matching the name of a Menu item in the parent app to the url value in the response. The url value does not need to be a url and can be any string, this works best however when unique strings are used.

Example & Use case

We have an app called Publishing News. Readers of Publishing News have two subscription types; silver and gold. Silver users get one Flipbook per month while Gold users get one per week.

We don’t want the silver users to see the weekly Flipbooks so we can create two different child apps under a single parent app. The child apps will contain the different Flipbooks for either subscription type.

In the parent app menu we then create a single menu with two options, one called silver and one called gold.

In our login endpoint we now return the option name that is appropriate for the logged in user’s subscription. So when a gold user logs into the app the url value is gold.

The app then matches these values up and automatically loads the gold child app ignoring the reset of the parent menu and the user never sees an option to load the silver child app. Likewise a silver user, would never see the option for the gold app.