PSR CAS, a standard PHP library for CAS authentication.
For improving the flexibility and in order to maximize it, it is able to authenticate users and leaves the session handling up to the developer.
In order to foster a greater adoption of this library, it has been built with interoperability in mind. It only uses PHP Standards Recommendations interfaces.
Therefore, this library is framework agnostic and uses only standard PSR interfaces for communication:
- PSR-7 for Requests, Responses and URI.
- PSR-17 for Requests, Responses and URI factories.
- PSR-18 for HTTP client.
- PSR-12 for coding standards.
composer require drupol/psrcas
||The CAS service base URL.|
||Redirect the user to that URL if no service parameter is provided after logout.|
||The CAS protocol specification.|
This is an example of a configuration in YAML, feel free to convert it in regular PHP array for PSR CAS.
base_url: https://localhost:7002/cas redirect_after_logout: http://localhost:8000/ protocol: login: path: /login allowed_parameters: - service - renew - gateway servicevalidate: path: /serviceValidate allowed_parameters: - service - ticket - pgtUrl - renew - format logout: path: /logout allowed_parameters: - service
Code style, code quality and tests
Every time changes are introduced into the library, Travis CI run the tests.
The library has tests written with PHPSpec.
PHPInfection is used to ensure that your code is properly tested.
To run the whole tests locally, run
See the file CONTRIBUTING.md but feel free to contribute to this library by sending Github pull requests.