Set up Set up user authentication

In this topic you will learn how to add basic user authentication to your CMS. Not all aspects of the user authentication can and will be covered. For a more thorough tutorial on user authentication, click here.

This topic though explains how to set up the unified login settings and how to create the user login page. The user registration page can be created easily using the User Registration Wizard, for both users and editors.

Configure authentication settings

MX Kollection 3 uses an unified set of authentication options. This way you only need to define or change the table, columns, access levels and redirect pages once, and it takes effect in all pages and behaviors that use it. Open the admin/index page before going any further to activate the Insert bar. These settings can be accessed from the MX Kollection tab of the Insert bar -> InterAKT Control Panel -> Login Settings.

The user interface is divided in four (4) tabs. Configure them as shown below.

  1. The Options tab - define basic authentication options:


                           

  2. The Database tab - define the table columns to use for user information:


                   

  3. The Session tab - define what session variables will be created when the user logs in. By default, three variables are created - for the user ID, username and access level. You can add more if you need them, but it is beyond the scope of this tutorial.


     

  4. The User levels tab -  define redirect pages and access levels:


                      

When you are done configuring the authentication options, click OK to close the user interface and save the settings.

Create the login page

After setting up the login options, you can proceed and create the login form. It will allow users enter their credentials and access the administration area. To create this form you will use the Login Form Wizard from MX Kollection:

  1. Open the admin/index page in Dreamweaver.

  2. Go to the MX Kollection tab of the Insert bar and click on the Login Form Wizard icon. The wizard is divided into two steps which you must configure.

  3. The first step of the wizard is mostly informative. It displays some of the options selected in the unified login settings. If you need to change them, or if you have not yet set them you can always click the Change Login Settings button to open the InterAKT Control Panel.


     

  4. In the second step of the wizard you can select some login specific options:


                         

  5. When done, click Finish to create the login form.

The wizard will add the HTML form and the application logic to handle the login process. If you want to test out the page, save it and press F12 to preview it in a browser. Use one of the pre-defined user accounts to test it out:

 

Restrict page access

The last thing to do regarding user authentication is to make sure that only registered and logged in users can access the article management pages - list and form.
To prevent other users from seeing the pages you will use another MX Kollection server behavior, namely Restrict Access To Page:
  1. Open the page to protect - admin/list.
  2. Go to the Server Behaviors tab > Plus (+) > MX Kollection > User Login and select the Restrict Access To Page server behavior.
  3. In the user interface that loads select the Username, password and access level radio button. Then select all items in the Select level(s) list:


                        
  4. Save the page and close it. If you try to load the page in a browser without being logged in, you will be redirected to the login page, namely admin/index.
  5. Repeat the steps above for the admin/form page.
In the next topic you will build the article list using NeXTensio.