Home / Content / Migrate from webauth to cas

Migrate from webauth to cas

Source: Cameo Hill

Drupal 6.x ‐ Installing CAS on ASU webhosting sites

(replacing ASU webauth module)

Preparation:

Download the CAS module from drupal.org:

Download this CAS library from Jasig:

Be sure you are using the newest ASU Zen theme (6.x‐3.4).

Install and configure CAS:
  1. Before you do anything, backup your site files and DB.
  2. FTP to your site files.
  3. Uncompress the CAS‐1.2.2.tgz archive to your desktop and rename it ‘CAS’.
  4. Create a folder named “libraries” inside the /sites/all folder so it’s parallel to the “themes” and “modules” folders.
  5. Upload the ‘CAS’ folder to this new “libraries” folder on the server.
  6. Open up your .htaccess file at the site root and add the following lines to the bottom of the file (be sure to replace the
    domain name with your site’s domain name). This will force the https version of your site pages to display – required for use with the CAS module.:
    # Force SSL
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://yoursite.asu.edu/$1 [L,R=301]
  7. Upload the “cas” module to your /sites/all/modules folder.
  8. Open up a browser window and go to your site’s phpMyAdmin URL and open up the site’s database. Keep that window
    open for the following steps.
  9. In a separate browser window, log into your site and navigate to the Modules listing (Site building > Modules).
  10. Disable the ASU Webauth module and enable the CAS module only (not the CAS Server module). Enabling the CAS module will create a new “cas_user” table in the database.
  11. Next,go to your phpMyAdmin data base window and run the following query to copy all the existing users (with the
    ‘webauth user’ role) over to the cas_users table. Note: You may need to edit the highlighted code below if your default user role has a different name:
    INSERT INTO cas_user (uid, cas_name)
    SELECT A.uid, A.name FROM users AS A
    JOIN users_roles AS B ON (A.uid = B.uid)
    JOIN role AS C ON (B.rid = C.rid)
    WHERE C.name = 'webauth user'
    AND A.uid NOT IN (SELECT D.uid FROM cas_user AS DWHERE D.uid = A.uid);
  12. After the users are copied over, go to your site permissions and be sure to add the correct CAS permissions for the admin role (User management > Permissions).
  13. Configure the CAS module in the settings page (User management > CAS Settings). Follow the example on this image:
    https://drupal.asu.edu/sites/default/files/wiki/cas-settings_1.png
  14. Test the module.