Single Username and Password Protection

Introduction

The mgiAuthenticate and mgiAuthenticateDB tags password-protect individual pages of your web site. When a visitor accesses a page with an mgiAuthenticate or mgiAuthenticateDB tag, the web browser displays a dialogue box and prompts the user to enter a username and password. If the correct username and password are entered, the page displays. If either an incorrect username or password is entered, an error page displays.

Use the mgiAuthenticate tag to password-protect a page with one static username and password. Use the mgiAuthenticateDB tag to password-protect a page with multiple usernames and passwords. The mgiAuthenticateDB tag can also be used to provide levels of access via groups. The authentication tags can only be used to password-protected individual pages. The authentication tags cannot be used to password-protect entire directories (folders) unless all pages in the directory contain the mgiAuthenticate or mgiAuthenticateDB tag.

In this example, an online client contract is password-protected.

MGI Tags

Steps

  1. Create a contract page and open it in a text editor.
  2. Insert the mgiAuthenticate tag.
  3. Save the contract page.
  4. FTP the contract page to the web server running MGI.
  5. View the contract page in a browser.


Step 1: Create a contract page and open it in a text editor.

Create a client contract page named "contract.mgi" and open the page in a text editing program that allows you to view and modify the HTML and code of the page.

Step 2: Insert the mgiAuthenticate tag.

Insert your cursor after the beginning <BODY> element and enter the mgiAuthenticate tag, username parameter and password parameter. Enter "SysTek" as the value of the username parameter. Enter "3H84cy7" as the value of the password parameter:
<mgiAuthenticate username="SysTek" password="3H84cy7">

Step 3: Save the contract page.

Save the changes you have made to the contract page.

Step 4: FTP the contract page to the web server running MGI.

Upload the contract page from your local computer to the web server using an FTP program.

Step 5: View the contract page in a browser.

Access the contract page in a web browser. An authentication dialogue box requesting a username and password appears. Enter "SysTek" in the username field. Enter "3H84cy7" in the password field and click the "OK" button. If the correct username and password are entered, the contract page is displayed. If an incorrect username or password is entered, an error page is displayed.


Comments and Notes

Usernames and passwords are both case-sensitive. When you distribute a username and password, note the importance of capitalization to the recipient.


[Return to the Authentication Menu]


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]