Skip to content
2 changes: 1 addition & 1 deletion src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ oauth:
team-id: team-id
key-id: key-id
redirect-url: "https://localhost:8080/auth/apple"
secret-key: MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCAfGIQ3TtNYAZG7i3m72odmdhfymkM9wAFg2rEL2RKUEA==
secret-key: MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCAfGIQ3TtNYAZG7i3m72odmdhfymkM9wAFg2rEL2RKUEA== # base64 encoded 된 임의의 값
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실제 키처럼 보이는 거엔 주석 표시하는 거 좋은 거 같습니다!
근데 이것만 실제 키처럼 따로 설정을 해주신 이유가 있을까요?

추가로 이렇게 키처럼 보이면 깃허브에서 따로 경고 안주나요? 이건 그냥 궁금해서 여쭤봅니다. 😅

Copy link
Collaborator Author

@nayonsoso nayonsoso Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String인 secretKey 가 인자로 전달되는
Base64.decodeBase64() 함수는 'Base64로 인코딩된 문자열'이어야 합니다.
image

저도 처음에는 이걸 모르고 'secret-key' 같은 평범한 문자열을 사용했는데, 런타임 에러가 발생하더라고요 😳
그래서 랜덤하게 만들어서 넣어줬습니다!


이렇게 키처럼 보이면 깃허브에서 따로 경고 안주나요?

안주더라고요~ 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 값은 디코드해도 의미없는 값이 나오는데 혹시 어떻게 생성하신건가요? 단순 호기심입니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 지피티한테 만드는 방법 물어봤씁니다 🤭
소스코드는 이러합니다!

try {
    KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
    kpg.initialize(new ECGenParameterSpec("secp256r1"), new SecureRandom());
    KeyPair kp = kpg.generateKeyPair();
    PrivateKey privKey = kp.getPrivate();

    String base64Encoded = Base64.getEncoder().encodeToString(privKey.getEncoded());
    System.out.println("Base64 Encoded EC Private Key:");
    System.out.println(base64Encoded);
} catch (Exception e) {
    e.printStackTrace();
}

kakao:
redirect-url: "http://localhost:8080/auth/kakao"
client-id: client-id
Expand Down
Loading