- Issue created by @Jaspreet Longia
- Assigned to Jaspreet Longia
- Merge request !32Update cas.routing.yml - added "user_is_logged_in" requirement to cas.login β (Open) created by Jaspreet Longia
- last update
7 months ago 100 pass - πΊπΈUnited States bkosborne New Jersey, USA
Going to make a new branch because this one was created with branch name 2.x and it's making it harder to review locally (I already have a branch with that name)
- Merge request !37Update cas.routing.yml - added "user_is_logged_in" requirement to cas.login β (Merged) created by bkosborne
- πΊπΈUnited States bkosborne New Jersey, USA
bkosborne β changed the visibility of the branch 2.x to hidden.
- Status changed to Needs review
6 months ago 2:00pm 4 June 2024 - Issue was unassigned.
- πΊπΈUnited States bkosborne New Jersey, USA
Thanks for the review. I'll see about extending that base class!
Another thing I want to try and resolve here is this scenario:
- Authenticated user clicks a link to /cas?destination=/some/page
- User is denied access to /cas since they're already logged in
- Our subscriber intercepts the exception and redirects the user to the homepage
- The /some/page destination is lost
We have at least one site that's using this workflow for links that this patch breaks.
- Status changed to Needs work
4 months ago 8:15am 25 July 2024 - π·π΄Romania claudiu.cristea Arad π·π΄
Given π AccessDeniedSubscriber should extend HttpExceptionSubscriberBase RTBC is RTBC and most likely will me merged, I think we should do it also here.
i think #11 makes sense
- πΊπΈUnited States bkosborne New Jersey, USA
Pushed an update that uses HttpExceptionSubscriberBase and preserves the destination parameter. Updated issue summary to describe the change.
- πΊπΈUnited States bkosborne New Jersey, USA
Updated the MR to be based on 3.x
- π·π΄Romania claudiu.cristea Arad π·π΄
Unfortunately tests are failing
- π·π΄Romania claudiu.cristea Arad π·π΄
Great. You can merge and release 3.0.0.
I propose the following release notes:
Relevant changes
- Drupal 11 compatibility (see "Updating to CAS 3.0" section below)
- Routes
/cas
and/caslogin
are no more accessible by logged in users. See π Change the cas route cas.login to have a route requirement _user_is_logged_in: 'FALSE'. This should effectively prevent access to the route for users that are already logged in. Active .
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.0
with 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 aCasProtocolVersion
enum case as parameter instead of a string. Same, theCasServerConfig::getProtocolVersion()
getter returns now aCasProtocolVersion
enum case instead of a string. If needed, get the server version as a legacy string:CasServerConfig::getProtocolVersion()->value
. - The
CasServerConfig::setHttpScheme()
setter accepts now aHttpScheme
enum case as parameter instead of a string. Same, theCasServerConfig::getHttpScheme()
getter returns now aHttpScheme
enum case instead of a string. If needed, get the HTTP scheme as a legacy string:CasServerConfig:: getHttpScheme()->value
. - The
CasServerConfig::setVerify()
setter accepts now aSslCertificateVerification
enum case as parameter instead of an integer. Same, theCasServerConfig::getVerify()
getter returns now aSslCertificateVerification
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 https://www.drupal.org/node/3462792 β to learn what is deprecated in CAS 3.0 and adapt your code.
-
bkosborne β
committed e9e48114 on 3.x
Issue #3446948: Prevent access to cas.login route, if user is already...
-
bkosborne β
committed e9e48114 on 3.x
Automatically closed - issue fixed for 2 weeks with no activity.