Skip to content

Commit 42837b5

Browse files
committed
feature #20234 [Security] Allow passport attributes in Security::login() (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [Security] Allow passport attributes in `Security::login()` Fix #20229 Commits ------- 7573d4a [Security] Allow passport attributes in `Security::login()`
2 parents f4e3dd3 + 7573d4a commit 42837b5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

security.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,12 @@ You can log in a user programmatically using the ``login()`` method of the
17671767
// you can also log in on a different firewall...
17681768
$security->login($user, 'form_login', 'other_firewall');
17691769

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

1773+
// ... and also add passport attributes
1774+
$security->login($user, 'form_login', 'other_firewall', [(new RememberMeBadge())->enable()], ['referer' => 'https://oauth.example.com']);
1775+
17731776
// use the redirection logic applied to regular login
17741777
$redirectResponse = $security->login($user);
17751778
return $redirectResponse;
@@ -1779,6 +1782,12 @@ You can log in a user programmatically using the ``login()`` method of the
17791782
}
17801783
}
17811784

1785+
.. versionadded:: 7.2
1786+
1787+
The support for passport attributes in the
1788+
:method:`Symfony\\Bundle\\SecurityBundle\\Security::login` method was
1789+
introduced in Symfony 7.2.
1790+
17821791
.. _security-logging-out:
17831792

17841793
Logging Out

0 commit comments

Comments
 (0)