2
votes

I just upgraded a project from Symfony 2.8 to Symfony 3.1, and now I have a problem. When I want to access my login page (which is my first page), I get an error message :

Full authentication is required to access this resource. 500 Internal Server Error - InsufficientAuthenticationException

So I can't log on and access my other pages.

Has anyone had the same problem?

PS : Here is my security.yml

jms_security_extra:
secure_all_services: false
expressions: true

security: encoders: Admin\UserBundle\Entity\User: sha512

providers:
    fos_userbundle:
        id: fos_user.user_provider.username

firewalls:
    # Firewall pour les pages de connexion, inscription, et récupération de mot de passe
    login:
        pattern:   ^/(login$|register|resetting)
        anonymous: true                           

    # Firewall principal pour le reste de notre site
    main:
        pattern: ^/
        anonymous: true
        form_login:
            provider:    fos_userbundle
            login_path:     fos_user_security_login
            default_target_path: common_authentification
        logout:
            path:       fos_user_security_logout
            target:     fos_user_security_login

access_control:
    - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/projectmanager, roles: ROLE_PROJECT_MANAGER }
    - { path: ^/admin, roles: ROLE_ADMIN }
    - { path: ^/contributor, roles: ROLE_USER }
    - { path: ^/operator, roles: ROLE_OPERATOR }
2
Have you tried dumping your cookies? - keyboardSmasher
Hi and sorry for my late answar, i diden't see your message... I already tried it but still the same problem... - dapebat

2 Answers

1
votes

This error appears when you need to be authenticated to access a resource, in your case it is telling you that to access your resource you need the IS_FULLY_AHTENTICATED role.

Try to remove the $ in access_control for the login resource

1
votes

Ok i found the problem. It was the jms security bundle who was obsolote. I deleted it and it's now working.