aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/github/scribejava/apis
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-12-01 08:44:40 +0300
committerGravatar Vitaly Takmazov2023-12-01 09:07:54 +0300
commitf3cfd364f9eb0efdec2abaffb3d48e6fc588ae1c (patch)
tree898f9796acfb80052440ceb0d197c8a27971f026 /src/main/java/com/github/scribejava/apis
parenta0b1b0050ce386d3e40d94b8b2973739877987b0 (diff)
Bump jjwt to 0.12.3
Upgrade API usage
Diffstat (limited to 'src/main/java/com/github/scribejava/apis')
-rw-r--r--src/main/java/com/github/scribejava/apis/AppleClientSecretGenerator.java18
1 files changed, 11 insertions, 7 deletions
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();
}