diff options
Diffstat (limited to 'src/main/java/com/juick')
-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 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)); } } |