File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,12 +30,19 @@ class IdTokenResponse extends BearerTokenResponse
3030 */
3131 protected $ claimExtractor ;
3232
33+ /**
34+ * @var string|null
35+ */
36+ protected $ keyIdentifier ;
37+
3338 public function __construct (
3439 IdentityProviderInterface $ identityProvider ,
35- ClaimExtractor $ claimExtractor
40+ ClaimExtractor $ claimExtractor ,
41+ ?string $ keyIdentifier = null
3642 ) {
3743 $ this ->identityProvider = $ identityProvider ;
3844 $ this ->claimExtractor = $ claimExtractor ;
45+ $ this ->keyIdentifier = $ keyIdentifier ;
3946 }
4047
4148 protected function getBuilder (AccessTokenEntityInterface $ accessToken , UserEntityInterface $ userEntity )
@@ -87,6 +94,10 @@ protected function getExtraParams(AccessTokenEntityInterface $accessToken)
8794 $ builder = $ builder ->withClaim ($ claimName , $ claimValue );
8895 }
8996
97+ if ($ this ->keyIdentifier !== null ) {
98+ $ builder = $ builder ->withHeader ('kid ' , $ keyIdentifier );
99+ }
100+
90101 if (
91102 method_exists ($ this ->privateKey , 'getKeyContents ' )
92103 && !empty ($ this ->privateKey ->getKeyContents ())
You can’t perform that action at this time.
0 commit comments