Authorizing a Short list of UW NetIDs

Last updated: January 12, 2023
Audience: All UW

To provide access to a short list of UW NetIDs:

  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 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 -w .htaccess

    The -w option turns off word wrap, which helps if you have a long list of UW NetIDs you want to authorize.

  4. Add the following text to this file:
    AuthType Shibboleth
    <IfVersion < 2.4>
      ShibCompatWith24 on
    </IfVersion>
    ShibRequestSetting requireSession true
    ShibRequestSetting redirectToSSL 443
    require shib-user joshg sallyt jcat
  5. Optional – If two factor authentication (2FA) is desired on depts, staff, faculty, or courses, then add the following text to this file instead:
    AuthType Shibboleth
    ShibRequestSetting requireSession true
    ShibRequestSetting redirectToSSL 443
    ShibRequestSetting applicationId 2fa
    <IfVersion < 2.4>
      ShibRequireAll on
      ShibCompatWith24 on
      require authnContextClassRef https://refeds.org/profile/mfa
      require shib-user joshg sallyt jcat
    </IfVersion>
    <IfVersion >= 2.4>
      <RequireAll>
        require authnContextClassRef https://refeds.org/profile/mfa
        require shib-user joshg sallyt jcat
      </RequireAll>
    </IfVersion>
  6. Replace the three example UW NetIDs with your own list of UW NetIDs. Make sure they are all on the same line, each separated by a space, just as you see above.
  7. Save and close the file using Nano. (Click for instructions on how to use nano).
  8. You’re done! Confirm that password protection is working by opening your website with a Web browser.