Skip to content

Commit

Permalink
Added iss and aud to generated access tokens.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniotarricone committed Dec 11, 2023
1 parent 4735eb6 commit 38ff17e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ public abstract class TokenService {
*/
@ConfigProperty(name = "refresh.duration")
long refreshDuration;

/*
* mil-auth base URL.
*/
@ConfigProperty(name = "base-url", defaultValue = "")
String baseUrl;

/*
* Token audience.
*/
@ConfigProperty(name = "token-audience", defaultValue = "mil.pagopa.it")
String audience;

/*
*
Expand Down Expand Up @@ -96,6 +108,8 @@ private Uni<String> generate(GetAccessTokenRequest request, long duration, List<
.claim(ClaimName.SCOPE, concat(scopes))
.claim(ClaimName.GROUPS, roles)
.claim(ClaimName.FISCAL_CODE, request.getFiscalCode())
.issuer(baseUrl)
.audience(audience)
.build();
Log.debug("Token signing.");
return tokenSigner.sign(payload).map(SignedJWT::serialize);
Expand Down

0 comments on commit 38ff17e

Please sign in to comment.