Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Symfony 4 Access Denied in logged in user submission form

$
0
0

I have a symfony 4 installation and I use the msgphp user bundle in order to authenticate the users. Despite the user logs in normally, when he tries to submit an entity form access denied error appears:

Access denied, the user is not fully authenticated; redirecting to authentication entry point.

I tried to modify the security yaml but I still get the same error. I would appreciate any help since I am novice in symfony.. I paste below my files:

security.yaml

 security:
        encoders:
            MsgPhp\User\Infrastructure\Security\UserIdentity: auto
        # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
        providers:
            msgphp_user: { id: MsgPhp\User\Infrastructure\Security\UserIdentityProvider }
        firewalls:
            dev:
                pattern: ^/(_(profiler|wdt)|css|images|js)/
                security: false
            main:
                anonymous: true
                provider: msgphp_user

                # activate different ways to authenticate

                # http_basic: true
                # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

                # https://symfony.com/doc/current/security/form_login_setup.html
                form_login:
                    login_path: /
                    check_path: /
                    default_target_path: /profile
                    username_parameter: email
                    password_parameter: password

                logout:
                    path: logout

        # Easy way to control access for large sections of your site
        # Note: Only the *first* access control that matches will be used
        access_control:
            # - { path: ^/admin, roles: ROLE_ADMIN }
            - { path: ^/profile, roles: ROLE_TRAVELER }

framework.yaml

framework:
    secret: '%env(APP_SECRET)%'
    csrf_protection: true
    #http_method_override: true

    # Enables session support. Note that the session will ONLY be started if you read or write from it.
    # Remove or comment this section to explicitly disable session support.
    session:
        handler_id: 'session.handler.native_file'
        save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
        cookie_secure: auto
        cookie_samesite: lax

    #esi: true
    #fragments: true
    php_errors:
        log: true

Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>