Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23210

Exception thrown when using alternative user provider/login handler

    XMLWordPrintable

Details

    Description

      When using an alternative user provider / login (FOSUserBundle) handler as per documentation at https://doc.ez.no/display/EZP/How+to+authenticate+a+user+with+multiple+user+providers and https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/index.md , some internal redirects (such as redirect to login, failed login_check, etc) will cause an exception.

      It appears the SiteAccess/Router expects a siteaccess string and is receiving an object instead.

      Steps to reproduce:
      1. Install and configure FOSUserBundle as documented
        1. configure firewall
          security:
              providers:
                  fos_userbundle:
                      id: fos_user.user_provider.username
              firewalls:
                  fos_user_firewall:
                      pattern:   ^/
                      anonymous: ~
                      provider:  fos_userbundle_provider
                      form_login:
                          provider:      fos_userbundle
                          login_path:    login
                          check_path:    login_check
                          default_target_path: /
                      logout:
                          path:       logout
                          target:     /
              access_control:
                  - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
                  - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
                  - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
                  - { path: ^/admin/, role: ROLE_ADMIN }
          
      2. Create a new user
        php ezpublish/console fos:user:create testuser
        
      3. Try to login with an invalid password (if all is properly configured, login with valid credentials should still work).

      Stack trace attached.

      Attachments

        Activity

          People

            Unassigned Unassigned
            joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m