diff options
author | Vitaly Takmazov | 2022-12-21 02:23:44 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-21 02:23:44 +0300 |
commit | 8a32b359eed27ab1d4e054ffed99b6602fa18acf (patch) | |
tree | 98d67588023c4eafe7690aea3cc26fb8b2029bd0 /src/main/java/com/juick/config | |
parent | 55293b4ac33e0f4fd2bfce3a0f5783b42812a65c (diff) |
Sign in with Apple: adopt records
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r-- | src/main/java/com/juick/config/SignInWithAppleConfig.java | 7 |
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 85e2bdd1b..2b0d3698c 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)); } } |