From f3cfd364f9eb0efdec2abaffb3d48e6fc588ae1c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Dec 2023 08:44:40 +0300 Subject: Bump jjwt to 0.12.3 Upgrade API usage --- .../scribejava/apis/AppleClientSecretGenerator.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/github/scribejava') diff --git a/src/main/java/com/github/scribejava/apis/AppleClientSecretGenerator.java b/src/main/java/com/github/scribejava/apis/AppleClientSecretGenerator.java index 21254550..df98ee64 100644 --- a/src/main/java/com/github/scribejava/apis/AppleClientSecretGenerator.java +++ b/src/main/java/com/github/scribejava/apis/AppleClientSecretGenerator.java @@ -30,13 +30,17 @@ public record AppleClientSecretGenerator(String subject, String teamId, String k public String getClientSecret() { Instant now = Instant.now(); return Jwts.builder() - .setHeaderParam("kid", keyId) - .setIssuer(teamId) - .setAudience("https://appleid.apple.com") - .setIssuedAt(Date.from(now)) - .setSubject(subject) - .setExpiration(Date.from(ZonedDateTime.ofInstant(now, ZoneId.of("UTC")).plusMonths(1).toInstant())) - .signWith(signingKey.getKey(), SignatureAlgorithm.ES256) + .header() + .add("kid", keyId) + .and() + .issuer(teamId) + .audience() + .add("https://appleid.apple.com") + .and() + .issuedAt(Date.from(now)) + .subject(subject) + .expiration(Date.from(ZonedDateTime.ofInstant(now, ZoneId.of("UTC")).plusMonths(1).toInstant())) + .signWith(SignatureAlgorithm.ES256, signingKey.getKey()) .compact(); } -- cgit v1.2.3