Authorizing Participants in a Course

Last updated: January 12, 2023
Audience: All UW

Follow these step-by-step instructions to password protect your website such that only people registered for a specific course can get in. This type of password protection will allow you to allow only students registered for a course and the instructors of the course to view your site.

Notes:

  • This type of authorization can only be used on course, faculty, staff, and departmental accounts.
  • Authorization data used to authorize course groups is updated nightly.

Instructions

These steps show how to restrict access to a website so only participants in a course can access it. The most difficult part of this type of authentication is formulating the string for the ‘require’ directive.

  1. Log into your web development server using a terminal emulator. If you’re not sure how to do this, click here for instructions.
  2. At the prompt, enter the following command to change directories to your Web directory:

    cd public_html

    If you want to password protect a subdirectory rather than your whole website, change directories to the subdirectory you want to protect. For example:

    cd private

  3. At the prompt, enter the following command to create a .htaccess file in the current working directory:

    nano .htaccess

  4. Add the following text to this file:
    AuthType Shibboleth
    <IfVersion < 2.4>
      ShibCompatWith24 on
    </IfVersion>
    ShibRequestSetting requireSession true
    ShibRequestSetting redirectToSSL 443
    require shib-attr isMemberOf urn:mace:washington.edu:groups:course_2018sum-acctg215aa

    The string 2018sum-acctg215aa is composed of five parts that identify the course you want to use. The first four numbers represent the year the course is being taught. The next three characters identify the quarter that the course is taught.

    Quarter Three Letter Code
    Autumn AUT
    Winter WIN
    Spring SPR
    Summer SUM

    The next part of the string represents the department offering the course. A list of abbreviations is maintained here. Following the abbreviation is the course number and then the section.Note: More than one course can be listed on the same line if you want to give access to multiple courses. For example:

    require shib-attr isMemberOf urn:mace:washington.edu:groups:course_2018sum-acctg215aa urn:mace:washington.edu:groups:course_2018sum-acctg215bb

  5. Save and close the file using Nano. (Click for instructions on how to use nano).
  6. You’re done! Confirm that password protection is working by opening your website with a Web browser.