Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
89.48 KB
MD5: 3da23170b692fcd20d0a47d2f63b536d
SHA-1: 638543e602d7ad44ccc44779bf1fa275dff49d67
SHA-256: 9c04552dc8ba3c500ab3bf4c59a10277df7b0164c77c93dc1ad35b7ec944f676
Download zip
149.29 KB
MD5: 3dc9754d4bcb1a0a2d1b6db9c8f59498
SHA-1: 0e579c252b2cdc9bd3a42473a5c494abd9071644
SHA-256: 17011c7feca5e92230202c9e538806f8692ea7c95ea1af730c356df64dba24b8
Release notes
Notable changes
- Drupal 11 compatibility (see "Updating to CAS 3.0" section below)
- Routes /cas and /caslogin are no longer accessible by logged in users. They will be redirected to the homepage instead of re-authenticating with CAS. See #3446948: Prevent access to cas.login route, if user is already logged in.
Updating to CAS 3.0
- While still on Drupal 10, update your site to CAS 2.3.2. This is very important because starting with CAS 3.0.0, old (post)update functions are removed.
- Require
drupal/cas:^3.0with Composer - If you have custom code that interacts with the CAS module, you may need to make some updates. There are some tiny backwards compatibility breaking changes that require your attention:
- The type of value returned by
CasLoginException::getCode()was changed from integer to enum of typeCasLoginExceptionType. If your code calls this method, you should adapt. If you still need the integer value, you can do something like
$codes = CasLoginExceptionType::cases(); $code = array_search($exception->getCode(), $codes, TRUE); - The parameter of
CasUserManager::getCasUsernameForAccount()is now strict typed as integer. Make sure you cast the parameter to an integer before is passed to the method:$account = ...; $uid = (int) $account->id(); $name = \Drupal::service('cas.user_manager')->getCasUsernameForAccount($uid); - The
CasServerConfig::setProtocolVersion()setter accepts now aCasProtocolVersionenum case as parameter instead of a string. Same, theCasServerConfig::getProtocolVersion()getter returns now aCasProtocolVersionenum case instead of a string. If needed, get the server version as a legacy string:CasServerConfig::getProtocolVersion()->value. - The
CasServerConfig::setHttpScheme()setter accepts now aHttpSchemeenum case as parameter instead of a string. Same, theCasServerConfig::getHttpScheme()getter returns now aHttpSchemeenum case instead of a string. If needed, get the HTTP scheme as a legacy string:CasServerConfig:: getHttpScheme()->value. - The
CasServerConfig::setVerify()setter accepts now aSslCertificateVerificationenum case as parameter instead of an integer. Same, theCasServerConfig::getVerify()getter returns now a SslCertificateVerification enum case instead of an integer. If needed, get the certificate verification scheme as a legacy integer:CasServerConfig:: getVerify()->value.
- The type of value returned by
- You can now update your site to Drupal 11.
- After updating to CAS 3.0, prepare for the next CAS version by replacing the deprecated code. Check #3462792: Some constants were deprecated and replaced with enums to learn what is deprecated in CAS 3.0 and adapt your code.