For Current Version at Authentication

This is Version 5

Your WaveMaker Studio application can include a login page that requires users to sign on in order to gain access to the application. In order to set up user authentication you need set up a data source that stores your user IDs and passwords. You have the following options for storing this data:

  • You can use any database supported by WaveMaker Studio.
  • You can use LDAP (Lightweight Directory Access Protocol).
Note that you cannot configure user roles in the community version of WaveMaker. You must use the enterprise version of Wavemaker for Role Based Access Controls

WaveMaker Studio also provides a simple "demo" data source. You can use this data source to set up and test your login page during development.

How to Set Up a Log In Page

To set up a login page for your application, follow these steps:

  1. Set up your data source.
  2. Run WaveMaker Studio and open your project.
  3. iconSecurity.png Click the Security icon. The Security Editor appears.
    securityEditor.png
  4. In the Data Source pull-down menu, select the type of data source you want to use. You can choose Database, LDAP or Demo. When you make your selection, the configuration editor for that data source appears at the bottom of the Security Editor (default is Demo).
  5. Make the appropriate selections for your data source in the configuration editor. This will depend on what type of data source you are using:
    Using a Database for Login Data
    Using LDAP for Login Data
    Using the Demo Data Source for Login Data
  6. Click to check the Authentication On check box. As you develop your application, you can use this check box to toggle the authentication on and off. That way, when you preview your application, you don't have to log in every time.
  7. Click the Save Configuration button. When you save a security configuration, WaveMaker Studio adds the security service and a default login page to your project.
  8. Save the project. The default login page (The Default Login Page) is now listed under Pages in the Dashboard. (You might need to refresh in order to see this page.)
  9. Preview the application. The default Login page appears. Try logging in.

Using the Demo Data Source for Login Data

The Demo data source provides a great design-time tool for authentication. With this data source you can quickly define a few usernames and passwords to use while creating and testing the login functionality for your application. Before you deploy your application, you should set up a more robust data source for authentication.

To set up To set up authentication against a the Demo data source, click the Security tab and choose Demo for the Data Source type. The Demo Data Source configuration editor appears.

To add a new user to the Demo data source:

  1. Type the name in the Username field.
  2. Type the Password in the Password field.
  3. Click the Add button (plus sign).
To delete an existing user from the Demo data source,

  1. Select the user in the list.
  2. Click the Delete button (X).
The Demo data source automatically includes one default user name (demo) and password (demo).

Using a Database for Login Data

If you're using a database to store your authentication data, then you first need to import the database you plan to use. The database must include a table that provides a column for your user names and one for the passwords. The user names and passwords must be stored in the same table in the database.

To set up authentication against a database, click the Security tab and choose Database for the Data Source type. You need to provide the following configuration information:

Property
Description
Data ModelThe Data Model that contains the columns for the for username,password. Choose the Data Model from the pull-down menu. (You have toimport the database first. If you have imported the database and itdoes not appear in this list, try saving the project and refreshing thepage).
EntitySelect the table that contains the columns for the user names and passwords.
User Name FieldSelect the column for the user (login) name.
Password FieldSelect the column for the password.
Be sure to save the configuration (click the Save Configuration button) before testing the authentication.

Using LDAP for Login Data

To set up authentication against a database, click the Security tab and choose LDAP for the Data Source type. You need to provide the following configuration information:

PropertyDescription
LDAP URLThis field specifies the host name and port number of the LDAP server.
ldap://localhost:389/dc=wavemaker,dc=com
Manager DNThe DN for the account that you use to access LDAP.
Manager PasswordThe password for the account that you use to access LDAP.
User DNPatternSets the pattern that WaveMaker Studio uses to create a DN for theuser. The pattern should be the name relative to the root DN. Thepattern argument {0} will contain the username. For example:
"cn={0},ou=people"
Be sure to save the configuration (click the Save Configuration button) before testing the authentication.

The Default Login Page

WaveMaker Studio provides a simple login page for you. Whenever you save an authentication configuration, WaveMaker Studio checks to see if you have a login page in your project. If you don't, WaveMaker Studio will add the default login page to the project.

You can customize the login page, but do not rename it. If you do, WaveMaker Studio will not recognize it as the login page.

The Security Service

When you create a security configuration for your project, WaveMaker Studio adds a Security Service to your project. The Security Service contains two operations:

  • getUserName: Use this operation to get the username of the current user. The operation takes no inputs and returns a string containing the userid of the user that is logged in on the current session.
  • logout: Use this operation to log a user out. This operation takes no inputs. When you call it, it logs out the current user and terminates the session.

      Share/Bookmark
© 2010 WaveMaker Software™ All Rights Reserved.