src/ServiceProviders/Security/AbstractSimplePreAuthenticator.php
protected function createAuthenticatedToken($user, $credentials, $providerKey)
    {
        return new PreAuthenticatedToken($user, $credentials, $providerKey, $user->getRoles());
    }
protected function createAuthenticatedToken($user, $credentials, $providerKey)
    {
        return new PreAuthenticatedToken($user, $credentials, $providerKey, $user->getRoles());
    }
protected function createAuthenticatedToken ( $ user , $ credentials , $ providerKey ) { return new PreAuthenticatedToken ( $ user , $ credentials , $ providerKey , $ user -> getRoles ( ) ) ; }
Creates an authenticated token upon authentication success.

Inherited class can override this method to provide their own pre-authenticated token implementation

@param string|UserInterface $user        The user
@param mixed                $credentials The user credentials
@param string               $providerKey The provider key

@return PreAuthenticatedToken
Creates an authenticated token upon authentication success .