Skip to content
PSR CAS, a PHP standard library for CAS authentication.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
spec/drupol/psrcas
src
.editorconfig
.gitattributes
.gitignore
.scrutinizer.yml
.travis.yml
LICENSE
README.md
composer.json
grumphp.yml.dist
infection.json.dist
phpspec.yml.dist

README.md

Latest Stable Version GitHub stars Total Downloads Build Status Scrutinizer code quality Code Coverage Mutation testing badge License Say Thanks! Donate!

PSR CAS

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.

Installation

composer require drupol/psrcas

Configuration

Parameter Description
base_url The CAS service base URL.
redirect_after_logout Redirect the user to that URL if no service parameter is provided after logout.
protocol The CAS protocol specification.

Example

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

Usage

TODO

Code style, code quality and tests

The code style is following PSR-12 plus a set of custom rules, the package drupol/php-conventions is responsible for this.

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

composer grumphp

Contributing

See the file CONTRIBUTING.md but feel free to contribute to this library by sending Github pull requests.

You can’t perform that action at this time.