You are here

README.txt in CAS 7

Introduction
============

Central Authentication Services (CAS) is a commonly used Single Sign-On
protocol used by many universities and large organizations. For a brief
introduction, please see the CAS website: https://www.apereo.org/projects/cas

The Drupal CAS project has two modules:

 * CAS:
     Drupal acts as a CAS client, allowing users to authenticate with a
     separate single sign-on CAS server.

 * CAS Server:
     Drupal acts as a CAS server.

Do NOT enable both modules at the same time, as it may lead to unpredictable
results.

The following README.txt covers the CAS module only. If you are interested in
the CAS Server module, please see README_SERVER.txt

Requirements
============
PHP 5 with the following extensions:
  curl, openssl, dom, zlib, and xml
phpCAS version 1.0.0 or later.

Installation
============

* Place the cas folder in your Drupal modules directory.

* Download phpCAS from https://wiki.jasig.org/display/CASC/phpCAS. You will
  need version 1.3.2 or later (1.3.3 for CAS 3.0 support). The most recent
  release is available at https://developer.jasig.org/cas-clients/php/current.tgz

* There are several locations you can install the phpCAS library.

  1. Module directory installation. This means installing the library folder
     under the modules directory, so that the file
     sites/<site>/modules/cas/CAS/CAS.php exists.

  2. System wide installation. See the phpCAS installation guide, currently at
     https://wiki.jasig.org/display/CASC/phpCAS+installation+guide

  3. Libraries API installation. Install and enable the Libraries API module,
     available at http://drupal.org/project/libraries. Then extract phpCAS so
     that sites/<site>/libraries/CAS/CAS.php exists. For example:
       $ cd sites/all/libraries
       $ curl https://developer.jasig.org/cas-clients/php/current.tgz | tar xz
       $ mv CAS-* CAS

* Go to Administer > Modules and enable this module.

* Go to Administer > Configuration > People > CAS to configure the CAS module.
  Depending on where and how you installed the phpCAS library, you may need
  to configure the path to CAS.php. The current library version will be
  displayed if the library is found.

Configuration & Workflow
========================

For the purposes of this example, assume the following configuration:
 * https://auth.example.com/cas - Your organization's CAS server
 * http://site.example.com/ - This Drupal site using the CAS module

Configure the CAS module:
 * Log in to the Drupal site and navigate to Admin > Configuration > People >
   Central Authentication Services.
 * Point the CAS module at the CAS server:
     - Hostname: auth.example.com
     - Port: 443
     - URI: /cas
 * Configure user accounts:
     - Decide if you want to automatically create Drupal user accounts for each
       CAS-authenticated user. If you leave this option deselected, you will
       have to manually add a paired Drupal account for every one of your users
       in advance.
     - Hide the Drupal password field if your users will never know (or need to
       know) their Drupal password.
 * Configure the login form(s):
     - There are four ways that a user can start the CAS authentication
       process:
         1. Visit http://site.example.com/cas
              This option is always available and is good for embedding a text
              "Login" link in your theme. (See the note to themers below).

         2. Click on a CAS Login menu link.
              The menu item is disabled by default, but may be enabled in
              Admin > Structure > Menus. You should find the link in the
              "Navigation" menu.

         3. Select the CAS login option on the Drupal login form.
              The CAS login option needs to be added to the login form in the
              CAS settings.

         4. Use the CAS login block.
              The CAS login block may be enabled in Admin > Structure > Blocks.

Note to Themers
===============

You may want to include a text CAS "Login" link in your theme. If you simply
link to "/cas", you will find that your users are redirected to the site
frontpage after they are authenticated. To redirect your users to the page
they were previously on, instead use:

  <?php
    print l(t('Login'), 'cas', array('query' => drupal_get_destination()));
  ?>

Upgrading from 6.x-2.x / Associating CAS usernames with Drupal users
=====================================================================

The following options have been depreciated:
* "Is Drupal also the CAS user repository?"
* "If Drupal is not the user repository, should CAS hijack users with the same name?"

The CAS module uses a lookup table (cas_user) to associate CAS usernames with
their corresponding Drupal user ids. The depreciated options bypassed this
lookup table and let users log in if their CAS username matched their Drupal
name. The update.php script has automatically inserted entries into the lookup
table so that your users will continue to be able to log in as before.

You can see the results of the update script and manage CAS usernames on the
"Administration >> People" (admin/people) page. A new column displays CAS
usernames, and the bulk operations drop-down includes options for rapidly
creating and removing CAS usernames. The "Create CAS username" option will
assign a CAS username to each selected account that matches their Drupal name.
The "Remove CAS usernames" option will remove all CAS usernames from the
selected accounts.  (Note: This will not appear if the Admin_Views module is used,
as it replaces the built-in People administration screen with a View)

API Changes Since 6.x-2.x
=========================
The hooks hook_auth_name() and hook_auth_filter() were combined and renamed
to hook_cas_user_alter(). See cas.api.php.

Testing
=======
The CAS module comes with built-in test routines. To enable testing on a
development site, enable the 'Testing' module. Then navigate to Admin >
Configuration > Development > Testing. The CAS test routines are available
under "Central Authentication Service".

Note, the CAS test routines will automatically download phpCAS from the JASIG
website, to ensure a version compatible with the test routines, and so that
the tests may run successfully on qa.drupal.org.

File

README.txt
View source
  1. Introduction
  2. ============
  3. Central Authentication Services (CAS) is a commonly used Single Sign-On
  4. protocol used by many universities and large organizations. For a brief
  5. introduction, please see the CAS website: https://www.apereo.org/projects/cas
  6. The Drupal CAS project has two modules:
  7. * CAS:
  8. Drupal acts as a CAS client, allowing users to authenticate with a
  9. separate single sign-on CAS server.
  10. * CAS Server:
  11. Drupal acts as a CAS server.
  12. Do NOT enable both modules at the same time, as it may lead to unpredictable
  13. results.
  14. The following README.txt covers the CAS module only. If you are interested in
  15. the CAS Server module, please see README_SERVER.txt
  16. Requirements
  17. ============
  18. PHP 5 with the following extensions:
  19. curl, openssl, dom, zlib, and xml
  20. phpCAS version 1.0.0 or later.
  21. Installation
  22. ============
  23. * Place the cas folder in your Drupal modules directory.
  24. * Download phpCAS from https://wiki.jasig.org/display/CASC/phpCAS. You will
  25. need version 1.3.2 or later (1.3.3 for CAS 3.0 support). The most recent
  26. release is available at https://developer.jasig.org/cas-clients/php/current.tgz
  27. * There are several locations you can install the phpCAS library.
  28. 1. Module directory installation. This means installing the library folder
  29. under the modules directory, so that the file
  30. sites//modules/cas/CAS/CAS.php exists.
  31. 2. System wide installation. See the phpCAS installation guide, currently at
  32. https://wiki.jasig.org/display/CASC/phpCAS+installation+guide
  33. 3. Libraries API installation. Install and enable the Libraries API module,
  34. available at http://drupal.org/project/libraries. Then extract phpCAS so
  35. that sites//libraries/CAS/CAS.php exists. For example:
  36. $ cd sites/all/libraries
  37. $ curl https://developer.jasig.org/cas-clients/php/current.tgz | tar xz
  38. $ mv CAS-* CAS
  39. * Go to Administer > Modules and enable this module.
  40. * Go to Administer > Configuration > People > CAS to configure the CAS module.
  41. Depending on where and how you installed the phpCAS library, you may need
  42. to configure the path to CAS.php. The current library version will be
  43. displayed if the library is found.
  44. Configuration & Workflow
  45. ========================
  46. For the purposes of this example, assume the following configuration:
  47. * https://auth.example.com/cas - Your organization's CAS server
  48. * http://site.example.com/ - This Drupal site using the CAS module
  49. Configure the CAS module:
  50. * Log in to the Drupal site and navigate to Admin > Configuration > People >
  51. Central Authentication Services.
  52. * Point the CAS module at the CAS server:
  53. - Hostname: auth.example.com
  54. - Port: 443
  55. - URI: /cas
  56. * Configure user accounts:
  57. - Decide if you want to automatically create Drupal user accounts for each
  58. CAS-authenticated user. If you leave this option deselected, you will
  59. have to manually add a paired Drupal account for every one of your users
  60. in advance.
  61. - Hide the Drupal password field if your users will never know (or need to
  62. know) their Drupal password.
  63. * Configure the login form(s):
  64. - There are four ways that a user can start the CAS authentication
  65. process:
  66. 1. Visit http://site.example.com/cas
  67. This option is always available and is good for embedding a text
  68. "Login" link in your theme. (See the note to themers below).
  69. 2. Click on a CAS Login menu link.
  70. The menu item is disabled by default, but may be enabled in
  71. Admin > Structure > Menus. You should find the link in the
  72. "Navigation" menu.
  73. 3. Select the CAS login option on the Drupal login form.
  74. The CAS login option needs to be added to the login form in the
  75. CAS settings.
  76. 4. Use the CAS login block.
  77. The CAS login block may be enabled in Admin > Structure > Blocks.
  78. Note to Themers
  79. ===============
  80. You may want to include a text CAS "Login" link in your theme. If you simply
  81. link to "/cas", you will find that your users are redirected to the site
  82. frontpage after they are authenticated. To redirect your users to the page
  83. they were previously on, instead use:
  84. print l(t('Login'), 'cas', array('query' => drupal_get_destination()));
  85. ?>
  86. Upgrading from 6.x-2.x / Associating CAS usernames with Drupal users
  87. =====================================================================
  88. The following options have been depreciated:
  89. * "Is Drupal also the CAS user repository?"
  90. * "If Drupal is not the user repository, should CAS hijack users with the same name?"
  91. The CAS module uses a lookup table (cas_user) to associate CAS usernames with
  92. their corresponding Drupal user ids. The depreciated options bypassed this
  93. lookup table and let users log in if their CAS username matched their Drupal
  94. name. The update.php script has automatically inserted entries into the lookup
  95. table so that your users will continue to be able to log in as before.
  96. You can see the results of the update script and manage CAS usernames on the
  97. "Administration >> People" (admin/people) page. A new column displays CAS
  98. usernames, and the bulk operations drop-down includes options for rapidly
  99. creating and removing CAS usernames. The "Create CAS username" option will
  100. assign a CAS username to each selected account that matches their Drupal name.
  101. The "Remove CAS usernames" option will remove all CAS usernames from the
  102. selected accounts. (Note: This will not appear if the Admin_Views module is used,
  103. as it replaces the built-in People administration screen with a View)
  104. API Changes Since 6.x-2.x
  105. =========================
  106. The hooks hook_auth_name() and hook_auth_filter() were combined and renamed
  107. to hook_cas_user_alter(). See cas.api.php.
  108. Testing
  109. =======
  110. The CAS module comes with built-in test routines. To enable testing on a
  111. development site, enable the 'Testing' module. Then navigate to Admin >
  112. Configuration > Development > Testing. The CAS test routines are available
  113. under "Central Authentication Service".
  114. Note, the CAS test routines will automatically download phpCAS from the JASIG
  115. website, to ensure a version compatible with the test routines, and so that
  116. the tests may run successfully on qa.drupal.org.