Of course, your Websnap application also needs a login page. Users enter their username and password for authentication, either while trying to access a restricted page or prior to such an attempt. The user can also specify which page they receive when authentication is completed. If the username and password match a user in the Web user list, the user acquires the appropriate access rights and is forwarded to the page specified on the login page. If the user isn't authenticated, the login page may be redisplayed (the default action) or some other action may occur.
Fortunately, WebSnap makes it easy to create a simple login page using a Web page module and the adapter page producer. To create a login page, start by creating a new Web page module. Choose FileNewOther, and select WebSnap from the Delphi Projects folder. In the right pane of the New Items window select the WebSnap Page Module. Select AdapterPageProducer as the page producer type. Fill in the other options however you like. Login tends to be a good name for the login page.
Now you should add the most basic login page fields: a username field, a password field, a selection box for selecting which page the user receives after logging in, and a Login button which submits the page and authenticates the user.
There is one more step necessary before your login page becomes functional. You need to specify which of your pages is the login page in your end user session adapter. To do so, select the EndUserSessionAdapter component in your Web application module. In the Object Inspector, change the LoginPage property to the name of your login page. Your login page is now enabled for all the pages in your Web server application.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|