File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ enum JwtTypesEnum: string
88{
99 case EntityStatementJwt = 'entity-statement+jwt ' ;
1010 case JwkSetJwt = 'jwk-set+jwt ' ;
11+ case Jwt = 'JWT ' ;
1112 case TrustMarkJwt = 'trust-mark+jwt ' ;
1213 case TrustMarkDelegationJwt = 'trust-mark-delegation+jwt ' ;
1314}
Original file line number Diff line number Diff line change 55namespace SimpleSAML \OpenID \Federation \Factories ;
66
77use SimpleSAML \OpenID \Algorithms \SignatureAlgorithmEnum ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
9+ use SimpleSAML \OpenID \Codebooks \JwtTypesEnum ;
810use SimpleSAML \OpenID \Federation \EntityStatement ;
911use SimpleSAML \OpenID \Jwk \JwkDecorator ;
1012use SimpleSAML \OpenID \Jws \Factories \ParsedJwsFactory ;
@@ -39,6 +41,11 @@ public function fromData(
3941 array $ payload ,
4042 array $ header ,
4143 ): EntityStatement {
44+
45+ if (!array_key_exists (ClaimsEnum::Typ->value , $ header )) {
46+ $ header [ClaimsEnum::Typ->value ] = JwtTypesEnum::EntityStatementJwt->value ;
47+ }
48+
4249 return new EntityStatement (
4350 $ this ->jwsDecoratorBuilder ->fromData (
4451 $ signingKey ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace SimpleSAML \OpenID ;
6+
7+ use Psr \Log \LoggerInterface ;
8+ use SimpleSAML \OpenID \Jwk \Factories \JwkDecoratorFactory ;
9+
10+ class Jwk
11+ {
12+ protected ?JwkDecoratorFactory $ jwkDecoratorFactory = null ;
13+
14+ public function __construct (
15+ protected readonly ?LoggerInterface $ logger = null ,
16+ ) {
17+ }
18+
19+ public function jwkDecoratorFactory (): JwkDecoratorFactory
20+ {
21+ return $ this ->jwkDecoratorFactory ??= new JwkDecoratorFactory ();
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments