Skip to content

Commit 6cb1ca8

Browse files
[SecurityBundle] Improve support for authenticators that don't need a user provider
1 parent 92ff56d commit 6cb1ca8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

security/access_token.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,25 @@ create your own User from the claims, you must
709709
}
710710
}
711711

712+
Using Self-Claimed Tokens
713+
-------------------------
714+
715+
You may use tokens that are self-claimed, meaning that they contain all
716+
the information needed to authenticate the user. This happens when a security
717+
token doesn't need a user provider to get all needed information about the
718+
user. For instance, a JWT can be self-claimed when it contains a username as
719+
well as the roles of the user.
720+
721+
When using self-claimed tokens with stateless firewalls, you can omit to
722+
configure a user provider. The token authenticator will use the token to
723+
create a user object with the claims of the token. This means that you can
724+
skip creating your own user provider.
725+
726+
.. versionadded:: 6.3
727+
728+
The possibility to omit the user provider in case of stateless firewalls
729+
and self-claimed tokens was introduced in Symfony 6.3.
730+
712731
.. _`JSON Web Tokens (JWT)`: https://datatracker.ietf.org/doc/html/rfc7519
713732
.. _`SAML2 (XML structures)`: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
714733
.. _`RFC6750`: https://datatracker.ietf.org/doc/html/rfc6750

0 commit comments

Comments
 (0)