Password Protection

You may wish to require a visitor to supply a valid username and password before they are allowed to access content from your Web space.  If you have not done so already, please force SSL on the directory that will contain the content that you wish to password protect.

  • Authenticate All Bronco NetID's
  • Authenticate a List of Bronco NetID's
  • Authenticate Guests
  • Generate Guest Usernames and Passwords
  • Authenticate All Bronco NetID's

    In this example any visitor with a valid Bronco NetID and password will be allowed to access the content. It is assumed that you have already forced SSL on the directory of content you wish to password protect.

    First create a distributed configuration file named either ".htsecure" or "x.htsecure".  Copy and paste the following. If you are using Dreamweaver to create this file, assure there is no other code other than that below:

    ##
    ## basic auth: system
    ##
    AuthType Basic
    AuthName "Your Bronco NetID"
    AuthBasicProvider external
    AuthExternal auth-system
    Require valid-user
    

    When complete, upload the file to the directory in the Web space that you wish to password protect.

    Test by using a browser to surf to the location that you are looking to password protect, and verify that you receive a prompt to enter a Bronco NetID and password before you are allowed to access the content.

    Authenticate a List of Bronco NetID's

    In this example, a list of specific Bronco NetID and passwords will be allowed to access the content, and no one else. It is assumed that you have already forced SSL on the directory of content you wish to password protect.

    First create a distributed configuration file named either ".htsecure" or "x.htsecure".  Copy and paste the following. If you are using Dreamweaver to create this file, assure there is no other code other than that below:

    ##
    ## basic auth: system
    ##
    AuthType Basic
    AuthName "Your Bronco NetID (bnid)"
    AuthBasicProvider external
    AuthExternal auth-system
    Require user bnid1 
    Require user bnid2 
    Require user bnid3
    

    NOTE Please replace "bnid1 bnid2 bnid3" with the usernames you wish to grant access to the content.

    When complete, upload the file to the directory in the Web space that you wish to password protect.

    Test by using a browser to surf to the location that you are looking to password protect, and verify that you receive a prompt to enter a Bronco NetID and password before you are allowed to access the content.

    Authenticate Guests

    In this example any visitor who can provide a valid guest username and password will be allowed to access the content. It is assumed that you have already forced SSL on the directory of content you wish to password protect.

    First, generate a user, or a list of users to authenticate against. Once you have created your ".htpasswd" or "x.htpasswd" file and uploaded it to the desired location in your Web space, move to the next step.

    Next create a distributed configuration file named either ".htsecure" or "x.htsecure".  Copy and paste the following. If you are using Dreamweaver to create this file, assure there is no other code other than that below:

    ##
    ## basic auth: file
    ##
    AuthType Basic
    AuthName "what you would like the user to see on the login page"
    AuthBasicProvider file
    AuthUserFile /unified/b/bnid/env.hostname/path/x.htpasswd
    Require user valid-user (where valid-user is the guest name you defined)
     

    NOTE In the string "/unified/b/bnid/env.hostname/path", please replace:

    1. "b" with the first initial, or character, of the Web server account name that you use to publish content to your Web space.
    2. "bnid" with the full account name that you use to publish content.
    3. "env.hostname" with the environment and hostname that you are defining this access restriction on, e.g. www.wmich.edu or homepages.wmich.edu
    4. "path" is optional. If your ".htpasswd" or "x.htpasswd" file is going to be published to the root of your Web space, then you do not need it. If you are publishing to a directory within your Web space, then you will need to specify the path to that directory. This does not include the Web alias defined for the Web server account name you use to publish.

    NOTE "/unified/b/bnid/env.hostname" and "http://env.hostname/bnid-web-alias/" are two different paths to the same location.

    When complete, upload the file to the directory in the Web space that you wish to password protect.

    Test by using a browser to surf to the location that you are looking to password protect, and verify that you receive a prompt to enter a Bronco NetID and password before you are allowed to access the content.

    Generate Guest Usernames and Passwords

    Use the form below to generate guest usernames and passwords for use with the basic authentication methods provided for on SERVER_NAME.

    Enter the guest username and password that is required, and then click the button to create the htpasswd entry. Copy and paste the generated line into a file named ".htpasswd" or "x.htpasswd". If multiple entries are created, place one per line in the htpasswd file. If you are using Dreamweaver to create this file, assure there is no other code other than that generated. When finished, this file should be uploaded to your Web space. Make note of it's location. You will need that information when you create the directory path to this file in the htsecure file that you will use to finish the basic file-based authentication.

     

    Need More Help?

    If you need assistance, the Help Desk is located down the hall at the end of the UCC lab. They may be reached by telephone at (269) 387-4357 (387-HELP), option 1, or by e-mail to helpdesk@wmich.edu