Book Image

IBM Worklight Mobile Application Development Essentials

Book Image

IBM Worklight Mobile Application Development Essentials

Overview of this book

Table of Contents (15 chapters)
IBM Worklight Mobile Application Development Essentials
Credits
About the Authors
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Form-based authentication


Form-based authentication is similar to a web application in which the users have to fill out a login form in order to access a secured or protected resource. Worklight provides a similar authentication mechanism in which the server returns the HTML of a login form whenever an application tries to access a protected resource.

The Worklight application that uses form-based authentication must use a login module to validate the received credentials.

Security realm

Declare the security realm with the name myFormBasedAppRealm as follows:

<realm name="myFormBasedAppRealm" loginModule="myFormBasedAppLoginModule">
  <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
</realm>

The login module

Now define the login module with the name myFormBasedAppLoginModule as we used the same for the loginModule attribute value to define the realm:

<loginModule name="myFormBasedAppLoginModule">
  <className>com.worklight.core.auth...