4D Web Login: Default Behavior

By default, 4D Web password protection is managed through the On Web Authentication method. If On Web Authentication returns a result of False, a password challenge is sent to the browser. If the Web user enters the user name and password correctly, the requested page is sent or method is run. This strategy works well, as long as the user enters their password correctly. If the password dialog is cancelled, a blank page is shown in the browser.

To see the default behavior for yourself, try a link to a protected page, a protected method called with 4DACTION, or protected method called with 4DCGI and cancel the browser's password challenge dialog.

Note: The user name is guest and the password is 4D. Enter these values to confirm the system does correctly protect resources. Remember that once a user name and password combination have been accepted, the browser continues to send them along with every new request. Therefore, once you enter the name and password listed above, all requests are accepted until the browser has quit.

If you want to display a custom page when the user cancels a browser password dialog or enters incorrect details, On Web Authentication doesn't work. Instead, authentication must be handled by On Web Connection and/or methods called directly through 4DACTION. To see this revised strategy in action, switch to the Web_Login_Custom example database.