Set up KU authentication on cPanel servers
Table of contents
What is this?
This is an alternative to Shibboleth that works on any KU server that runs PHP 5.6 or higher (tested through PHP 7.3). No external dependencies outside of the
ku-auth-this-script.php file are required.
- Go to https://websupport.ku.edu/sites/websupport.ku.edu/files/ku-auth-this-script.php and save it as a file named
- Go to the login page for your site (e.g., cpanel.unit.ku.edu) and log in with that site's credentials.
- Click on the link named
File Manager, go to the directory named
public_html, and upload
index.phpon your site, add the following line at the very top of the file:
<?php require_once 'ku-auth-this-script.php'; ?>
That's it! Now, users are required to log in through single sign-on (SSO) in order to use the site. If there are any other pages, add that line in step 4 to the very top of the scripts for those pages, too.
If you only want some users to be able to access the site, make a new file in
.htaccess and add the following line (substitute your username for
SetEnv KU_AUTH_ALLOWED_USERS c567l966
For example, if your site used to use Shibboleth and you have the following line in your
.htaccess to allow certain users,
require user firstname.lastname@example.org email@example.com firstname.lastname@example.org
That line may be rewritten for KU Auth as follows:
SetEnv KU_AUTH_ALLOWED_USERS "example anotherusername etcetera"
Keep in mind that these need to be the actual usernames, not just email addresses. You can use directory.ku.edu to see what the usernames for different users are. For example, if you go to https://directory.ku.edu/directory/details?details=c567l966 , the email address is email@example.com but the username is c567l966.