aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-21 02:23:44 +0300
committerGravatar Vitaly Takmazov2022-12-21 02:23:44 +0300
commit8a32b359eed27ab1d4e054ffed99b6602fa18acf (patch)
tree98d67588023c4eafe7690aea3cc26fb8b2029bd0 /src/main/java/com/juick
parent55293b4ac33e0f4fd2bfce3a0f5783b42812a65c (diff)
Sign in with Apple: adopt records
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/config/SignInWithAppleConfig.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/juick/config/SignInWithAppleConfig.java b/src/main/java/com/juick/config/SignInWithAppleConfig.java
index 85e2bdd1..2b0d3698 100644
--- a/src/main/java/com/juick/config/SignInWithAppleConfig.java
+++ b/src/main/java/com/juick/config/SignInWithAppleConfig.java
@@ -23,10 +23,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
+import org.tomitribe.churchkey.Keys;
import java.io.IOException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
@Configuration
public class SignInWithAppleConfig {
@@ -40,8 +39,8 @@ public class SignInWithAppleConfig {
private Resource keyPath;
@Bean
- AppleClientSecretGenerator clientSecretGenerator() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException {
+ AppleClientSecretGenerator clientSecretGenerator() throws IOException {
byte[] pemData = IOUtils.toByteArray(keyPath.getInputStream());
- return new AppleClientSecretGenerator(appId, teamId, keyId, pemData);
+ return new AppleClientSecretGenerator(appId, teamId, keyId, Keys.decode(pemData));
}
}