Giter Site home page Giter Site logo

casbundle's People

Contributors

acidjames avatar mhetru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

casbundle's Issues

erreur avec phpcas 1.3.9

Bonjour,
une nouvelle version du PHPCAS vient de sortir (version 1.3.9)
elle génère une erreur "phpCAS::client(): ErrorException: Warning: session_set_save_handler(): Cannot change save handler when session is active"
La version 1.3.8 elle fonctionne toujours.
je ne sais pas si le correctif est à fait du coté CasBundle ou bien si il faut attendre un Fix de la version 1.3.9

FosRestApi Symfony and cas firewall

I have a web application which uses for the react js front part and the symfony backend and a cas sso authentication server.
I have configured react to authenticate with case and the backend part also configured with case. The user is authenticated on both applications. But the problem that I can not use the api rest of the backend because it is not recognized that it is connected to because via axios http requests.
I saw that it was necessary to set up a proxy case.
Do you have any information on this use case and how to do it?
Does your example take into account the proxy case?
This link details the API call in case.
https://apereo.github.io/cas/5.0.x/installation/Configuring-Proxy-Authentication.html
Regards

Double Identification avec CasBundle

Bonjour,

merci pour ce bundle !

j'ai installé le CasBundle sur une application Symfony 4. J'arrive bien à l'identification.

J'aurai voulu savoir s'il était possible de paramétrer deux adresses CAS ?

Puisqu'il n'y a qu'une config l3_cas possible, comment lui permettre l'identification via deux services possibles ? ex : monservice.identification.fr et mondeuxiemeservice.identification.fr ?

Auriez-vous une astuce ?

Merci pour votre retour

Add compatibility for phpCAS 1.6 (security release)

phpCAS 1.6 was released recently to address a security concern. In previous versions, the library automatically generated the service URL (URL of the symfony app you're protecting) by using various HTTP request headers like Host or X-Forwarded-Host. These can be faked, leading to a serious security issue. phpCAS 1.6 requires you explicitly set the service base URL instead.

Symfony 6.0 compatibility

Hello, many thanks for your great efforts! Really appreciate your time and your helpful bundle :)
I am wondering if I can use this CAS bundle for Symfony 6 for now?

Thank you again!

Two authentications strategies

Hi,

what I want to do is two authentications strategies:

image

  • centralized use CAS
  • local use standard symfony users

What I have done:

  • a template security/login.html.twig with two link, one for cas, one for local authentication
  • a classical login form for local login
  • a redirect to cas server for login and logout

This is the controller:

class SecurityCasController extends AbstractController
{
    /**
     * @Route("/login", name="login", methods={"GET", "POST"})
     */
    public function login(AuthenticationUtils $authenticationUtils)
    {
        return $this->render(
            'security/login.html.twig',
            [
            ]
        );
    }


    /**
     * @Route("/cas/login", name="cas-login", methods={"GET", "POST"})
     */
    public function caslogin(Request $request)
    {
        if (!isset($_SESSION)) {
            session_start();
        }

        session_destroy();
        $url = 'https://'.$this->getParameter('cas_host') . $this->getParameter('cas_path') . '/login?service=';
        return $this->redirect($url . urlencode($request->getSchemeAndHttpHost()));
    }

    /**
     * @Route("/cas/logout", name="cas-logout", methods={"GET", "POST"})
     */
    public function casLogout(Request $request)
    {
        if (!isset($_SESSION)) {
            session_start();
        }

        session_destroy();
        $url = 'https://'.$this->getParameter('cas_host') . $this->getParameter('cas_path') . '/logout?service=';
        return $this->redirect($url . urlencode($request->getSchemeAndHttpHost()));
    }

This is security.yaml:

security:
  encoders:
    App\Entity\User:
      algorithm: bcrypt

  providers:
    app_users:
      entity: { class: App\Entity\User, property: email }

  role_hierarchy:
    ROLE_ADMIN:       ROLE_USER

  firewalls:
    dev:
      pattern: ^/(_(profiler|wdt)|css|images|js)/
      security: false
    login_choice:
      pattern: ^/login
      security: false
    local_login:
      pattern: ^/local/login
      security: false
    cas_login:
      pattern: ^/cas/login
      security: false
    main:
      anonymous: ~
      pattern: ^/
      security: true
      cas: true
      provider: app_users
      form_login:
        provider: app_users
        login_path: login
        check_path: login
  access_control:
    - { path: ^/, role: ROLE_USER }

My question: is this approach correct?

Thanks in advance for your ideas.
v.

User Deprecated: phpCAS::setDebug() is deprecated in favor of phpCAS::setLogger()

I'm getting this output log message using version 1.1.11 (latest version allowed for a SF 3.4):

php.INFO: User Deprecated: phpCAS::setDebug() is deprecated in favor of phpCAS::setLogger(). {"exception":"[object] (ErrorException(code: 0): User Deprecated: phpCAS::setDebug() is deprecated in favor of phpCAS::setLogger(). at [...]/vendor/jasig/phpcas/source/CAS.php:470)"} []

Used in Security/CasListener.php:28

Utilisation avec FOSUserBundle

Bonjour et merci pour cette intégration du CAS

J’utilise FosUserBundle, je n'ai pas de problème avec la configuration force: true mais lorsque que je passe se paramètre a false.

J'ai cette belle erreur Username "NO_USER" does not exist ... ce qui est normal

Avez-vous plus de précision sur l'usage du paramètre force: false ??

Typo in code CasListener.php

Sorry no time for forking / pull request, a colleague asked me to debug a problem in his code using your bundle I think therse is a typo in CasBundle/Security/CasListener.php

line 29 :
\phpCas::client(CAS_VERSION_2_0, $this->getParameter('host'),
$this->getParameter('port'), is_null($this->getParameter('path')) ? '' :
$this->getParameter('path'), true);

should be :

\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('host'),
$this->getParameter('port'), is_null($this->getParameter('path')) ? '' :
$this->getParameter('path'), true);

am I wrong ?

Switch_user et Login_form

Bonjour,
Je viens d'essayer votre bundle pour l'intranet de notre lycée avec succès (Symfony 3.2), merci.
Il me reste deux problèmes à régler
- Est ce possible d'utiliser votre bundle en parallèle du login form dans security.yml (même provider, même firewall). Le but est d'avoir une connexion CAS et un fallback sur le login_form en cas de failure.
- Implanter switch_user, cela ne semble pas fonctionner pour l'instant.
si je fais http://127.0.0.1:8000/accueil?_switch_user=leuser le user est bien basculé à leuser puis je suis redirigé (intercept_redirects: true) vers la page accueil ... et repassé en admin :c/

D'avance merci pour tout aide
Philippe

Clarification request

Hi,

Thanks for this bundle, I will have to try it soon.

I have a simple request, I would like to understand why the GuardAuthenticator is not used to do the authentication.
What are the benefit of not using it against using it in this particular case (CAS authentication).

Thanks :-)

Http redirection

Hello,
I noticed that the redirection to the CAS server is only for HTTPS page. Is there a possibility to redirect to simple HTTP page ?
Here is my configuration :

l3_cas:
    host: xx.xx.xx.xx
    path: cas
    port: 443
    ca: false
    handleLogoutRequest: true
    casLogoutTarget: localhost:4200
    force: true

Thank you

Switch to Open Source licence?

Would you be able to switch to an Open Source licence for this project please? (MIT, *GPL, Apache, etc)

This could encourage people to participate to this project :)

Cannot configure AuthenticatorManager as "cas" authentication does not support it,

Bonjour,
nous avons besoin de faire une double authentification Formulaire et CAS
avec synfony 5.3 il y a le paramètre "enable_csrf: true" qui demande d'activer l'authenticator manager
security:
# you must use the authenticator manager
enable_authenticator_manager: true

Or nous avons un messagd d'erreur qui dit que le bundle cas n'est pas compatible.

Cannot configure AuthenticatorManager as "cas" authentication does not support it, set "security.enable_authenticator_manager" to false.

y a t'il un moyen de le rendre compatible ?
Merci.

Questions a propos de CasListener

Bonjour monsieur,

Mon francais n'est pas si bon, et je ne sais pas comment faire des accents avec mon ordinateur, alors s'il vous plait me pardonnez des erreurs. Je m'expliquerai en Anglais apres tout.

Dans le CasListener, vous faisez ca:

    if ($this->getParameter('gateway')) {
        
        // .. code de pierre pelisset (pour les applis existantes...)
        
        if($this->getParameter('force')) {
            \phpCAS::forceAuthentication();
            $force = true;
        } else {
            $force = false;
             ...
        }
        if(!$force) {
            ...
        }
        
    } else { 
        if($this->getParameter('force')) {
            \phpCAS::forceAuthentication();
        } else {
                  ...
        }
    } 

Et finalement a la fin de l'action, vouz essayez de creer un token et le mettre dans le TokenStorage avec les resultats de forceAuthentication().

Est-ce que ce serait plus facile de verifier le parametre force avant verifier le parametre gateway? Ce semble que les deux parametres sont independant. Vous faisez le meme chose pour force, si gateway est vrai et si c'est faux. Si vous verifiez le parametre force avant le parametre gateway, il n'y aura pas besoin de utiliser le variable booleen $force, parce que si vous etez arrive (c'est le passe compose, ici) dans le code pour verifier gateway, vouz savez que le parametre force est faux.

Ce ne donnera pas les memes resultats?

En Anglais, maintenant:

You do the same thing for the "force" parameter regardless of whether or not "gateway" is true, and "force" does not influence what you do in the "gateway" parameter logic (other than the $force boolean, which wouldn't be needed if you separated the verification of "force"). Would separating the two checks (first "force", then "gateway") not give the same results?

Symfony needs %cas% quoted

First of all, thanks for this bundle. It works better than any of the others and I am very happy with it.

Second of all, just as a heads up, I'm getting nag warnings that in services.yml you will need to quote %cas% (like "%cas%") or this will not be compatible with Symfony 4.

Thanks!

Sean

switch_user

bonjour,
je mets en place une nouvelle appli SF4.4 avec votre bundle pour authentification CAS.
Cette partie fonctionne très bien mais je rencontre un souci avec le switch_user. Je ne sais pas si c'est lié...
Si mon utilisateur n'a pas le droit d'appeler l'url, je ne fais jeter.
Si l'utilisateur que je passe en paramètre n'existe pas dans ma base de données (selon mon user_provider), je ne fais jeter.
Donc tout semble être bien vérifié, sauf que je ne switch pas. La page est rafraîchi avec mon user de base.
Avez-vous une idée de ce qui peut coincer s'il vous plaît ?

Compatiblité php 8

Bonjour !

Je ne suis pas très à l'aide avec la création de bundle tout ça, et j'ai besoin d'un bundle pour une connexion CAS. J'ai trouvé le votre, sauf que je suis sur les denières versions de Symfony et PHP.
Serait-il possible de mettre à jour le composer.json afin le rendre compatible avec la version 8 de PHP et 5.2 de symfony svp ? (Car en essayant de fork, je ne sais pas comment l'installer avec composer à partir de mon repo...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.