Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1767,9 +1767,12 @@ You can log in a user programmatically using the ``login()`` method of the
// you can also log in on a different firewall...
$security->login($user, 'form_login', 'other_firewall');

// ...and add badges
// ... add badges...
$security->login($user, 'form_login', 'other_firewall', [(new RememberMeBadge())->enable()]);

// ... and also add passport attributes
$security->login($user, 'form_login', 'other_firewall', [(new RememberMeBadge())->enable()], ['referer' => 'https://oauth.example.com']);

// use the redirection logic applied to regular login
$redirectResponse = $security->login($user);
return $redirectResponse;
Expand All @@ -1779,6 +1782,12 @@ You can log in a user programmatically using the ``login()`` method of the
}
}

.. versionadded:: 7.2

The support for passport attributes in the
:method:`Symfony\\Bundle\\SecurityBundle\\Security::login` method was
introduced in Symfony 7.2.

.. _security-logging-out:

Logging Out
Expand Down
Loading