You are here

README.txt in CAS 6.3

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 Jasig website: http://www.jasig.org/cas/about

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 modules:
  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.0.0 or later. The most recent release is available at
  http://downloads.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 moduels 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 http://downloads.jasig.org/cas-clients/php/current.tgz | tar xz
       $ mv CAS-* CAS

* Go to Administer > Site Building > Modules and enable this module.

* Go to Administer > User Management > CAS Setings 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 > User Management >
   CAS Settings.
 * 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 > Site Building > 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 > Site Building >
              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
"Administer >> User Management >> Users" (admin/user/user) page. The CAS
usernames are shown in parentheses next to the Drupal username. 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.

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, download and enable the 'SimpleTest' module
(http://drupal.org/project/simpletest). The CAS test routines require a
version of SimpleTest newer than 6.x-2.11 -- for example, 6.x-2.x-dev.
Then navigate to Admin > Site Building > 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 Jasig website: http://www.jasig.org/cas/about
  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 modules:
  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.0.0 or later. The most recent release is available at
  26. http://downloads.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 moduels 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 http://downloads.jasig.org/cas-clients/php/current.tgz | tar xz
  38. $ mv CAS-* CAS
  39. * Go to Administer > Site Building > Modules and enable this module.
  40. * Go to Administer > User Management > CAS Setings 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 > User Management >
  51. CAS Settings.
  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 > Site Building > 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 > Site Building >
  78. Blocks.
  79. Note to Themers
  80. ===============
  81. You may want to include a text CAS "Login" link in your theme. If you simply
  82. link to "/cas", you will find that your users are redirected to the site
  83. frontpage after they are authenticated. To redirect your users to the page
  84. they were previously on, instead use:
  85. print l(t('Login'), 'cas', array('query' => drupal_get_destination()));
  86. ?>
  87. Upgrading from 6.x-2.x / Associating CAS usernames with Drupal users
  88. ====================================================================
  89. The following options have been depreciated:
  90. * "Is Drupal also the CAS user repository?"
  91. * "If Drupal is not the user repository, should CAS hijack users with the same name?"
  92. The CAS module uses a lookup table (cas_user) to associate CAS usernames with
  93. their corresponding Drupal user ids. The depreciated options bypassed this
  94. lookup table and let users log in if their CAS username matched their Drupal
  95. name. The update.php script has automatically inserted entries into the lookup
  96. table so that your users will continue to be able to log in as before.
  97. You can see the results of the update script and manage CAS usernames on the
  98. "Administer >> User Management >> Users" (admin/user/user) page. The CAS
  99. usernames are shown in parentheses next to the Drupal username. The bulk
  100. operations drop-down includes options for rapidly creating and removing CAS
  101. usernames. The "Create CAS username" option will assign a CAS username to each
  102. selected account that matches their Drupal name. The "Remove CAS usernames"
  103. option will remove all CAS usernames from the selected accounts.
  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, download and enable the 'SimpleTest' module
  112. (http://drupal.org/project/simpletest). The CAS test routines require a
  113. version of SimpleTest newer than 6.x-2.11 -- for example, 6.x-2.x-dev.
  114. Then navigate to Admin > Site Building > Testing. The CAS test routines are
  115. available under "Central Authentication Service".
  116. Note, the CAS test routines will automatically download phpCAS from the JASIG
  117. website, to ensure a version compatible with the test routines, and so that
  118. the tests may run successfully on qa.drupal.org.