title: "Username could not be found" error when using HWIOAuthBundle with FOSUserBundle
body: <p>Stumped here. Using HWIOAuthBundle to allow social login with FOSUserBundle on Symfony3.</p>
  
  <p>Log in with username and password functions fine, but when authenticating with social logins (in my case, Facebook and LinkedIn), error "Username could not be found" is returned on a redirect to the login page.</p>
  
  <p>Any ideas?</p>
  
  <p>Relevant portions of relevant files:</p>
  
  <p><strong>config.yml</strong></p>
  
  <pre><code>fos_user:
      db_driver: orm
      firewall_name: main
      user_class: AppBundle\Entity\User
  
  hwi_oauth:
      firewall_names: [secured_area]
      connect:
          account_connector: hwi_oauth.user.provider.fosub_bridge
          confirmation: true
      resource_owners:
          facebook:
              type:                facebook
              client_id:           xxx
              client_secret:       xxx
          linkedin:
              type:                linkedin
              client_id:           xxx
              client_secret:       xxx
      fosub:
          username_iterations: 30
          properties:
              facebook: facebookId
              linkedin: linkedinId
  </code></pre>
  
  <p><strong>security.yml</strong></p>
  
  <pre><code>security:
      encoders:
          FOS\UserBundle\Model\UserInterface: bcrypt
  
      role_hierarchy:
          ROLE_ADMIN:       ROLE_USER
          ROLE_SUPER_ADMIN: ROLE_ADMIN
  
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username
  
      firewalls:
          dev:
              pattern: ^/(_(profiler|wdt|error)|css|images|js)/
              security: false
  
          secured_area:
              anonymous: ~
              form_login:
                  provider: fos_userbundle
                  csrf_token_generator: security.csrf.token_manager
              oauth:
                  resource_owners:
                      facebook:   "/login/check-facebook"
                      linkedin:   "/login/check-linkedin"
                  login_path:     /login
                  use_forward:    false
                  failure_path:   /login
                  check_path:     /login
                  oauth_user_provider:
                      service: hwi_oauth.user.provider.fosub_bridge
  
              logout:
                  path: /logout
  
  
          main:
              pattern: ^/
              logout:       true
              anonymous:    true
  
  
      access_control:
          - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/connect$, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/admin/, role: ROLE_ADMIN }
  </code></pre>
  
  <p><strong>routing.yml</strong></p>
  
  <pre><code>fos_user:
      resource: "@FOSUserBundle/Resources/config/routing/all.xml"
  
  hwi_oauth_connect:
      resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
      prefix:   /login
  
  hwi_oauth_login:
      resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
      prefix:   /login
  
  hwi_oauth_redirect:
      resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
      prefix:   /login
  
  facebook_login:
      path: /login/check-facebook
  
  linkedin_login:
      path: /login/check-linkedin
  </code></pre>
  
  <p><strong>User.php</strong></p>
  
  <pre><code>&lt;?php
  // src/AppBundle/Entity/User.php
  
  namespace AppBundle\Entity;
  
  use FOS\UserBundle\Model\User as BaseUser;
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="fos_user")
   */
  class User extends BaseUser
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @ORM\Column(type="string", length=200, name="firstName", nullable=true)
       */
      protected $firstName;
  
      /**
       * @ORM\Column(type="string", length=200, name="lastName", nullable=true)
       */
      protected $lastName;
  
      /**
       * @ORM\Column(name="facebookId", type="string", length=255, nullable=true)
       */
      private $facebookId;
  
      /**
       * @ORM\Column(name="linkedinId", type="string", length=255, nullable=true)
       */
      private $linkedinId;
  
      private $facebookAccessToken;
  
  
      public function getFirstName() {
          return $this-&gt;firstName;
      }
  
      public function getLastName() {
          return $this-&gt;lastName;
      }
  
      public function setFirstName($firstName)
      {
          $this-&gt;firstName = $firstName;
          return $this;
      }
  
      public function setLastName($setLastName)
      {
          $this-&gt;lastName = $setLastName;
          return $this;
      }
  
       /**
       * @param string $facebookId
       * @return User
       */
      public function setFacebookId($facebookId)
      {
          $this-&gt;facebookId = $facebookId;
  
          return $this;
      }
  
      /**
       * @param string $linkedinId
       * @return User
       */
      public function setLinkedinId($linkedinId)
      {
          $this-&gt;linkedinId = $linkedinId;
  
          return $this;
      }
  
  
      /**
       * @return string
       */
      public function getFacebookId()
      {
          return $this-&gt;facebookId;
      }
  
      /**
       * @return string
       */
      public function getLinkedinId()
      {
          return $this-&gt;linkedinId;
      }
  
      /**
       * @param string $facebookAccessToken
       * @return User
       */
      public function setFacebookAccessToken($facebookAccessToken)
      {
          $this-&gt;facebookAccessToken = $facebookAccessToken;
  
          return $this;
      }
  
      /**
       * @return string
       */
      public function getFacebookAccessToken()
      {
          return $this-&gt;facebookAccessToken;
      }
  
      public function __construct()
      {
          parent::__construct();
          // your own logic
      }
  }
  </code></pre>