Skip to content

Commit d8be724

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Minor tweaks [Security] Add documentation for the security:oidc:generate-token command
2 parents 801a830 + 1e48456 commit d8be724

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

security/access_token.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,31 @@ create your own User from the claims, you must
864864
}
865865
}
866866

867+
Creating a OIDC token from the command line
868+
-------------------------------------------
869+
870+
.. versionadded:: 7.4
871+
872+
The ``security:oidc:generate-token`` command was introduced in Symfony 7.4.
873+
874+
The ``security:oidc:generate-token`` command helps you generate JWTs. It's mostly
875+
useful when developing or testing applications that use OIDC authentication:
876+
877+
.. code-block:: terminal
878+
879+
# generate a token using the default configuration
880+
$ php bin/console security:oidc:generate-token [email protected]
881+
882+
# specify the firewall, algorithm, and issuer if multiple are available
883+
$ php bin/console security:oidc:generate-token [email protected] \
884+
--firewall="api" \
885+
--algorithm="HS256" \
886+
--issuer="https://example.com"
887+
888+
.. note::
889+
890+
The JWK used for signing must have the appropriate `key operation flags`_ set.
891+
867892
Using CAS 2.0
868893
-------------
869894

@@ -1082,3 +1107,4 @@ for :ref:`stateless firewalls <reference-security-stateless>`.
10821107
.. _`OpenID Connect Discovery`: https://openid.net/specs/openid-connect-discovery-1_0.html
10831108
.. _`RFC6750`: https://datatracker.ietf.org/doc/html/rfc6750
10841109
.. _`SAML2 (XML structures)`: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
1110+
.. _`key operation flags`: https://www.iana.org/assignments/jose/jose.xhtml#web-key-operations

0 commit comments

Comments
 (0)