Investigate contrib library (ecphp/cas-lib) for authentication

Created on 12 May 2020, about 4 years ago
Updated 12 February 2023, over 1 year ago

Hi,

When I was working with Drupal actively, I remember that I evaluated this module.

Now that I'm working with Symfony at European Commission β†’ , I had to create a bundle for authenticating users with EU Login (eCAS).
It's using a modified version of the CAS protocol, this is why it is named eCAS.

I was looking for a good solution for the CAS protocol in Symfony and I came to the conclusion that I had to build something from the ground.
We evaluated PHPCAS but it was not meeting the expected level of quality that we wanted to have.

I then started to build a new library for authentication. I started the library on my own umbrella in drupol/psrcas and then, the European Commission forked my package in ecphp/cas-lib.

Then, 2 Symfony bundles were created.
* ecphp/cas-bundle, which depends on ecphp/cas-lib.
* ecphp/eu-login-bundle, which depends on ecphp/cas-bundle.

It's been a couple of months that those bundles and libraries are used at European Commission, but as they are open-sourced, they are also used by some other organisms (as you can see in their respective issue queue)

During the development phase, I contacted cilefen β†’ and bkosborne β†’ on Slack to let them know that I was developing something new for CAS authentication.

And here I am.

After a couple of months, those bundles are used by our clients, without any issue so far. I'm in a team were I can dedicate time for those Open Source packages and we are really picky when it comes to software quality !!!

The goal of this post is to propose you to use ecphp/cas-lib as CAS handler in your module.
It would remove quite a lot of code related to the protocol from the module, quite some tests and quite a hassle as well !

The library ecphp/cas-lib has been built with interoperability in mind and can be used on any framework.
I invite you to have a look at the automated generation documentation site: https://ecphp-cas-lib.readthedocs.io/en/latest/ to have a better overview of the library.

Demos (login: casuser, pass: Mellon):
See it here integrated into Symfony (through ecphp/cas-bundle): https://cas-bundle-demo.herokuapp.com/
See it here integrated into plain PHP app: https://psrcas-php-demo.herokuapp.com/

Let me know if you need more information, I'll be happy to help you people to use it in Drupal :-)

πŸ“Œ Task
Status

Active

Version

2.0

Component

CAS

Created by

πŸ‡§πŸ‡ͺBelgium Pol Brussels

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium Pol Brussels
  • πŸ‡§πŸ‡ͺBelgium Pol Brussels

    Hey,

    Since 2020, the time I wrote the initial message, a few things has been updated and I wanted to add a few more information here.

    First, I released ecphp/cas-lib version 2. The release 2 has been a complete refactoring and rewrite of the library, removing the things that was making the library stateful. Basically, in Version 1, the request had to be injected in the constructor, making the binding in the container a bit more complex. In Version 2, the request is injected in the methods we call from the library (login, logout, serviceValidate, etc etc).

    Then, very recently, a Laravel package has been created, it's available at: https://github.com/ecphp/laravel-cas
    We have now 2 packages on top of `ecphp/cas-lib`, one for Symfony and one for Laravel.

    Also, the links in the bottom of the original message are no more available since Heroku is no more free.

    I still believe that using an external library to handle the CAS protocol would be a good idea in this project, since it would make things clearer. The Drupal module would act as the glue code between Drupal and `ecphp/cas-lib`, just like the packages for Symfony and Laravel.

    Let me know if I can be of any help.

    Bye!

Production build 0.69.0 2024