Worklight Security
The model of Worklight security is that we define an "authentication realm". Think of this as a
named set of steps to authenticate users. Each realm is composed of one "Authenticator" and one
"Login Module" which are components found on the server.
Worklight comes with predefined authenticators including:
• form based – com.worklight.core.auth.ext.FormBasedAuthenticator
• adapter based – com.worklight.integration.auth.AdapterAuthenticator
• HTTP header based
Custom authenticators can be built in Java. Authenticators are defined in the realm by class names.
The Login Module is used to verify the user credentials and creates a "user identity" object that
holds the user's properties for the remainder of the session.
Login modules provided by IBM include:
• Web service calls
• Database look calls
• WebSphere LTPA tokens
• Non validating –
com.worklight.core.auth.ext.NonValidatingLoginModule
Worklight also introduces the concept of a "Security Test". This is an ordered collection of
"authentication realms" that should be used to validate that a user can access a resource.
During access to a resource, if the identity of the user is unknown, a "challenge" is issued. This is
where the user presents their claim and proof of who they are. Typically this is a userid/password
combination. The challenge is performed by a "Challenge Handler". The challenge handler gathers
these from the user and then invokes the Authenticator. The Authenticator then passes this
information to the Login module which performs the actual validation of the user's identity and
builds the "user identity" object.
A challenge handler can be created with
WL.Client.createChallengeHandler("realm-name").
Security is configured in the authenticationConfig.xml file that is found in the project's
server/conf folder. This is a plain XML file.
An adapter implementation can use the WL.Server.getActiveUser() to obtain a security
user object.
<realm name="MyRealm" loginModule="MyLoginModule">
<className>com.worklight.integration.auth.AdapaterAuthenticator</className>
<parameter name="login-function" value="MyAdapter.onAuthRequired" />
<parameter name="logout-function" value="MyAdapter.onLogout" />
</realm>
See also:
• Section 8: Authentication and security – IBM presentations and samples
Research Questions
Page 297
Comentários a estes Manuais