Skip to content

Improve support for authenticators that don't need a user provider #19122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2023
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
19 changes: 19 additions & 0 deletions security/access_token.rst
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,25 @@ create your own User from the claims, you must
}
}

Using Self-Claimed Tokens
-------------------------

You may use tokens that are self-claimed, meaning that they contain all
the information needed to authenticate the user. This happens when a security
token doesn't need a user provider to get all needed information about the
user. For instance, a JWT can be self-claimed when it contains a username as
well as the roles of the user.

When using self-claimed tokens with stateless firewalls, you can omit to
configure a user provider. The token authenticator will use the token to
create a user object with the claims of the token. This means that you can
skip creating your own user provider.

.. versionadded:: 6.3

The possibility to omit the user provider in case of stateless firewalls
and self-claimed tokens was introduced in Symfony 6.3.

.. _`JSON Web Tokens (JWT)`: https://datatracker.ietf.org/doc/html/rfc7519
.. _`SAML2 (XML structures)`: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
.. _`RFC6750`: https://datatracker.ietf.org/doc/html/rfc6750
Expand Down