Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider
This class provides storage for the tokens that is set in "remember me" cookies. This way no password secrets will be stored in the cookies on the client machine, and thus the security is improved.
This depends only on doctrine in order to get a database connection
and to do the conversion of the datetime column.
In order to use this class, you need the following table in your database:
CREATE TABLE `rememberme_token` (
`series` char(88) UNIQUE PRIMARY KEY NOT NULL,
`value` char(88) NOT NULL,
`lastUsed` datetime NOT NULL,
`class` varchar(100) NOT NULL,
`username` varchar(200) NOT NULL
);
Synopsis
class DoctrineTokenProvider
implements
TokenProviderInterface
{
- // members
- private Connection $conn;
- // methods
- public void __construct()
- public void loadTokenBySeries()
- public void deleteTokenBySeries()
- public void updateToken()
- public void createNewToken()
Hierarchy
Members
private
- $conn
—
\Doctrine\DBAL\Connection
Doctrine DBAL database connection F.ex. service id: doctrine.dbal.default_connection
Methods
public
- __construct() — new DoctrineTokenProvider for the RemembeMe authentication service
- createNewToken() — {@inheritdoc}
- deleteTokenBySeries() — {@inheritdoc}
- loadTokenBySeries() — {@inheritdoc}
- updateToken() — {@inheritdoc}