@@ -537,15 +537,12 @@ claims. To create your own user object from the claims, you must
537
537
2) Configure the OidcTokenHandler
538
538
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
539
539
540
- The ``OidcTokenHandler `` requires ``web-token/jwt-signature ``,
541
- ``web-token/jwt-checker `` and ``web-token/jwt-signature-algorithm-ecdsa ``
542
- packages. If you haven't installed them yet, run these commands:
540
+ The ``OidcTokenHandler `` requires the package ``web-token/jwt-library ``.
541
+ If you haven't installed it yet, run this command:
543
542
544
543
.. code-block :: terminal
545
544
546
- $ composer require web-token/jwt-signature
547
- $ composer require web-token/jwt-checker
548
- $ composer require web-token/jwt-signature-algorithm-ecdsa
545
+ $ composer require web-token/jwt-library
549
546
550
547
Symfony provides a generic ``OidcTokenHandler `` to decode your token, validate
551
548
it and retrieve the user info from it:
@@ -561,10 +558,10 @@ it and retrieve the user info from it:
561
558
access_token :
562
559
token_handler :
563
560
oidc :
564
- # Algorithm used to sign the JWS
565
- algorithm : ' ES256'
561
+ # Algorithms used to sign the JWS
562
+ algorithms : [ 'ES256', 'RS256']
566
563
# A JSON-encoded JWK
567
- key : ' {"kty":"...","k":"..."}'
564
+ keyset : ' {"keys":[{" kty":"...","k":"..."}] }'
568
565
# Audience (`aud` claim): required for validation purpose
569
566
audience : ' api-example'
570
567
# Issuers (`iss` claim): required for validation purpose
@@ -589,8 +586,10 @@ it and retrieve the user info from it:
589
586
<!-- Algorithm used to sign the JWS -->
590
587
<!-- A JSON-encoded JWK -->
591
588
<!-- Audience (`aud` claim): required for validation purpose -->
592
- <oidc algorithm = " ES256 " key = " {' kty':'...','k':'...'}" audience =" api-example" >
589
+ <oidc keyset = " {'keys':[{' kty':'...','k':'...'}] }" audience =" api-example" >
593
590
<!-- Issuers (`iss` claim): required for validation purpose -->
591
+ <algorithm >ES256</algorithm >
592
+ <algorithm >RS256</algorithm >
594
593
<issuer >https://oidc.example.com</issuer >
595
594
</oidc >
596
595
</token-handler >
@@ -610,9 +609,9 @@ it and retrieve the user info from it:
610
609
->tokenHandler()
611
610
->oidc()
612
611
// Algorithm used to sign the JWS
613
- ->algorithm( 'ES256')
612
+ ->algorithms([ 'ES256', 'RS256'] )
614
613
// A JSON-encoded JWK
615
- ->key ('{"kty":"...","k":"..."}')
614
+ ->keyset ('{"keys":[{" kty":"...","k":"..."}] }')
616
615
// Audience (`aud` claim): required for validation purpose
617
616
->audience('api-example')
618
617
// Issuers (`iss` claim): required for validation purpose
@@ -636,8 +635,8 @@ configuration:
636
635
token_handler :
637
636
oidc :
638
637
claim : email
639
- algorithm : ' ES256'
640
- key : ' {"kty":"...","k":"..."}'
638
+ algorithms : [ 'ES256', 'RS256']
639
+ keyset : ' {"keys":[{" kty":"...","k":"..."}] }'
641
640
audience : ' api-example'
642
641
issuers : ['https://oidc.example.com']
643
642
@@ -657,7 +656,9 @@ configuration:
657
656
<firewall name =" main" >
658
657
<access-token >
659
658
<token-handler >
660
- <oidc claim =" email" algorithm =" ES256" key =" {'kty':'...','k':'...'}" audience =" api-example" >
659
+ <oidc claim =" email" keyset =" {'keys':[{'kty':'...','k':'...'}]}" audience =" api-example" >
660
+ <algorithm >ES256</algorithm >
661
+ <algorithm >RS256</algorithm >
661
662
<issuer >https://oidc.example.com</issuer >
662
663
</oidc >
663
664
</token-handler >
@@ -677,8 +678,8 @@ configuration:
677
678
->tokenHandler()
678
679
->oidc()
679
680
->claim('email')
680
- ->algorithm( 'ES256')
681
- ->key ('{"kty":"...","k":"..."}')
681
+ ->algorithms([ 'ES256', 'RS256'] )
682
+ ->keyset ('{"keys":[{" kty":"...","k":"..."}] }')
682
683
->audience('api-example')
683
684
->issuers(['https://oidc.example.com'])
684
685
;
0 commit comments