Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpcas Guard Bundle Laravel Package

alexandret/phpcas-guard-bundle

View on GitHub
Deep Wiki
Context7

Php CAS Bundle

PhpCas Bundle provide CAS Authentication using guard for symfony 3.4+ and 4.

This bundle DO NOT provide a CAS server. By using this bundle, your application will be able to use your Cas Server to authenticate your users.
SymfonyInsight Coverage Status Build Status

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require "alexandret/phpcas-guard-bundle" "~1"

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

<?php

return [
    //...
    AlexandreT\Bundle\CasGuardBundle\CasGuardBundle::class => ['all' => true],
];

Step 3: Enable the Security

Update your config\packages\security.yaml file:

#http://symfony.com/doc/current/reference/configuration/security.html#full-default-configuration
security:
    # ...
    firewalls:
        #Main firewall
        main:
            # We use Guard !
            guard:
                authenticators:
                    # ADD the cas authenticator declared in this bundle
                    - phpcasguard.cas_authenticator
            # The logout path
            logout:
                # This route will be never called because of listener. It will catch it and redirect user.                
                path: /logout
                # ADD the same cas authenticator declared in this bundle to activate logout function
                success_handler: phpcasguard.cas_authenticator  
    # ...

Since Symfony 2.8, Guard is providing a new and excellent way to authenticate. I recommend you to have a look on this excellent tutorial to understand guard features. This tutorial explains how to generate a standard authentication using guard and a login form. When you understand it, you only have to disable the call to the login form authenticator implemented in the chapter 5 and replace it by the phpcasguard.cas_authenticator declared inside this bundle.

Step 4: Configure the Bundle

Create a config\packages\cas_guard.yaml file:

cas_guard:
    hostname: '%env(CAS_HOSTNAME)%'
    # ...

Have a look on the complete configuration file to complete and connect it with your CAS server.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor