Skip to content

Commit

Permalink
feat: add sub to JWT in Sign response mode
Browse files Browse the repository at this point in the history
  • Loading branch information
damikael committed Oct 12, 2023
2 parents 385f623 + ef59917 commit 178fbb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ResponseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ protected function makeJWS($payload, $exp_time, $iss, $aud, $jwk_pem): string {
'data' => $payload, // Authentication Data
];

if(array_key_exists('fiscalNumber', $payload)) { // Subject - fiscalNumber, only if exists
$data['sub'] = $payload['fiscalNumber'];
}

$algorithmManager = new AlgorithmManager([new RS256()]);
$jwk = JWKFactory::createFromKeyFile($jwk_pem);
$jwsBuilder = new JWSBuilder($algorithmManager);
Expand Down

0 comments on commit 178fbb8

Please sign in to comment.