2017 © Pedro Peláez
 

symfony-bundle casauth-bundle

Basic CAS (SSO) authenticator for Symfony 3 and 4

image

prayno/casauth-bundle

Basic CAS (SSO) authenticator for Symfony 3 and 4

  • Thursday, July 26, 2018
  • by prayno
  • Repository
  • 5 Watchers
  • 12 Stars
  • 1,586 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 5 Open issues
  • 7 Versions
  • 76 % Grown

The README.md

CasAuthBundle

Basic CAS (SSO) authenticator for Symfony 3 and 4, (*1)

This bundle provides a -very- basic CAS (http://jasig.github.io/cas/4.1.x/index.html) authentication client for Symfony 3 and 4., (*2)

Installation

Install the library via Composer by running the following command:, (*3)

composer require prayno/casauth-bundle

Next, enable the bundle in your app/AppKernel.php file:, (*4)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new PRayno\CasAuthBundle\PRaynoCasAuthBundle(),
        // ...
    );
}

In config.yml (Symfony 3) or config/packages/p_rayno_cas_auth.yaml (create this file in Symfony 4), add these settings :, (*5)

p_rayno_cas_auth:
    server_login_url: https://mycasserver/cas/
    server_validation_url: https://mycasserver/cas/serviceValidate
    server_logout_url: https://mycasserver/cas/logout
    xml_namespace: cas
    options:[] see http://docs.guzzlephp.org/en/latest/request-options.html

Note : the xml_namespace and options parameters are optionals, (*6)

Modify your security.yml with the following values (the provider in the following settings should not be used as it's just a very basic example ; in production, create your own UserProvider and add its service name in providers:cas:id) : ```yaml security: providers: cas: id: prayno.cas_user_provider, (*7)

firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false
    main:
        anonymous: ~
        logout: ~
        guard:
            authenticators:
                - prayno.cas_authenticator

access_control:
    - { path: ^/, roles: ROLE_USER }

```, (*8)

And voila ! Your secured route should redirect you to your CAS login page which should authenticate you., (*9)

CAS global logout option

If you want your users to logout from the remote CAS server when logging out from your app, you should apply the following settings :, (*10)

security.yaml:, (*11)

```yaml, (*12)

...

firewalls:
    # ...
    main:
      # ...
      logout:
        path: /logout
        success_handler: PRayno\CasAuthBundle\Event\LogoutSuccessHandler

```, (*13)

services.yaml, (*14)

```yaml, (*15)

...

services: # ... PRayno\CasAuthBundle\Event\LogoutSuccessHandler: arguments: $logoutUrl: "%cas_logout_url%" ```, (*16)

Of course, you must set a "cas_logout_url" parameter in your app (eg. https://my_remote_cas_server/logout), (*17)

Don't forget to define a /logout route in your app, (*18)

The Versions

26/07 2018

dev-master

9999999-dev

Basic CAS (SSO) authenticator for Symfony 3 and 4

  Sources   Download

MIT GPL

The Requires

 

by Pierre Raynaud

sso guard symfony 3 cas prayno symfony 4

30/08 2016

v1.1.1

1.1.1.0

Basic CAS (SSO) authenticator for Symfony 3

  Sources   Download

GPL

The Requires

 

by Pierre Raynaud

sso guard symfony 3 cas prayno

25/03 2016

v1.1

1.1.0.0

Basic CAS (SSO) authenticator for Symfony 3

  Sources   Download

GPL

The Requires

 

by Pierre Raynaud

sso guard symfony 3 cas prayno

05/02 2016

v1.0.1

1.0.1.0

Basic CAS (SSO) authenticator for Symfony 3

  Sources   Download

GPL

The Requires

 

by Pierre Raynaud

sso guard symfony 3 cas prayno

04/02 2016

v1.0

1.0.0.0

Basic CAS (SSO) authenticator for Symfony 3

  Sources   Download

GPL

The Requires

 

by Pierre Raynaud

sso guard symfony 3 cas prayno