How to send specific settings for a user with a specific role

Created on 19 September 2023, over 1 year ago
Updated 6 March 2024, about 1 year ago

Problem/Motivation

Currently we can force 2FA for our website for all users, because we can get config using "CasHelper::EVENT_PRE_REDIRECT" event, but we don't want to do it for regular users. We want to force moderation for some roles on our website. For example admins, managers.
Unfortunately, it is possible with the current event, because it doesn't have any information about the current user. Other events are triggered too late.
Is it possible to achieve it ? Or we need customizations in the module?
If yes let me know where, I can work on this issue. Thanks

✨ Feature request
Status

Closed: works as designed

Version

2.2

Component

CAS

Created by

πŸ‡§πŸ‡ͺBelgium lobsterr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lobsterr
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    If I understand correctly, you want to modify the URL the user is redirected to (to append some information that forces 2FA?), but only for users of a certain role? I don't see how this is possible. When CAS redirects to the CAS server for authentication, it doesn't know who the user is. The CAS module only knows who the user is after the authentication process is completed.

    2FA should be implemented within your CAS server.

    Unless, are you implementing 2FA within the Drupal site, separate from your CAS server login?

  • πŸ‡§πŸ‡ͺBelgium lobsterr

    Yes, I wonder, if we could have some info about user in EVENT_PRE_LOGIN. Is it too early and we don't have any info about user? And another probably would be too late to force 2 factor authentication ? Right?

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    It's not possible to deliver information about the user in EVENT_PRE_LOGIN. The CAS module has no idea who the user is until they actually authenticate with the CAS server.

    I suppose you could implement 2FA after the CAS authentication process has been completed, but before you log the user in, but really, the proper way to do 2FA here is within your CAS server.

  • Status changed to Closed: works as designed about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium lobsterr

    Thank for info, I appreciate it

Production build 0.71.5 2024