Skip to content

Commit

Permalink
[FIX] 애플 소셜 로그인 key 파일 읽기 형식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaeAg committed Oct 3, 2024
1 parent 0d95783 commit eb0341a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
env:
API_KEY: ${{ secrets.APPSTORE_API_KEY_ID }}
run: |
mkdir -p src/main/resources/static
echo "${{ secrets.APPLE_AUTH_KEY }}" > src/main/resources/static/AuthKey_$API_KEY.p8
mkdir -p src/main/resources/static/apple
echo "${{ secrets.APPLE_AUTH_KEY }}" > src/main/resources/static/apple/AuthKey_$API_KEY.p8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
env:
API_KEY: ${{ secrets.APPSTORE_API_KEY_ID }}
run: |
mkdir -p src/main/resources/static
echo "${{ secrets.APPLE_AUTH_KEY }}" > src/main/resources/static/AuthKey_$API_KEY.p8
mkdir -p src/main/resources/static/apple
echo "${{ secrets.APPLE_AUTH_KEY }}" > src/main/resources/static/apple/AuthKey_$API_KEY.p8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
import com.nimbusds.jwt.SignedJWT;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.security.KeyFactory;
import java.security.interfaces.ECPrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Date;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.util.io.pem.PemObject;
import org.bouncycastle.util.io.pem.PemReader;
import org.json.simple.JSONObject;
Expand Down Expand Up @@ -188,7 +190,7 @@ private void signJwt(SignedJWT jwt) {

private byte[] readPrivateKey(String keyPath) {
Resource resource = new ClassPathResource(keyPath);
try (PemReader pemReader = new PemReader(new FileReader(resource.getFile()))) {
try (PemReader pemReader = new PemReader(new InputStreamReader(resource.getInputStream()))) {
PemObject pemObject = pemReader.readPemObject();
return pemObject.getContent();
} catch (IOException e) {
Expand Down

0 comments on commit eb0341a

Please sign in to comment.