Creating adapter-based authentication

Adapter-based authentication is the simplest form of authentication provided in Worklight. It uses the adapter procedure/function to validate and authenticate the users and create their sessions. Plus, it provides all the features of the Worklight authentication framework.

Please use the following simple steps to implement adapter-based authentication:

  1. Create a new Worklight project with the name ABADemo; for the application, use the name myAdapterBasedAuthentication.
  2. Add an adapter and give it a name: myAuthAdapter. Paste the following sample function code into the adapter.js file:
    function onAuthRequired(headers, errorMessage){ errorMessage = errorMessage ? errorMessage : null; return { authRequired: true, errorMessage: ...

Get IBM Worklight Mobile Application Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.