aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/github
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/github')
-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();
}