Custom Form Password Authenticator return only UserInterface symfony Custom Form Password Authenticator return only UserInterface symfony symfony symfony

Custom Form Password Authenticator return only UserInterface symfony


You probably have something confused.

The AdvancedUserInterface - indicate user instance, and extends from UserInterface.

The UserProviderInterface - indicate of providers for loads users (UserInterface).

In method loadUserByUsername you can returns AdvancedUserInterface instances.

As example:

User:

class User implements AdvancedUserInterface{  // .. Some fields and functions}

User Provider:

class MyUserProvider implements UserProviderInterface{  public function loadUserByUsername($username)  {     // Get the User instance from DB or another system     return $user;  }  // Some functions}