2023 11 14 OAuth2 KAKAO Error : There was an unexpected error (type=Internal Server Error, status=500). This class supports `client_secret_basic`, `client_secret_post`, and `none` by default. Client [kakao] is using [POST] instead.

XingXi·2023년 11월 14일
1

기록

목록 보기
3/33

🌭 BEFORE

🌮 application.properties

# KAKAO
spring.security.oauth2.client.registration.kakao.client-id=[API ID]
spring.security.oauth2.client.registration.kakao.client-secret=[Secret key]
spring.security.oauth2.client.registration.kakao.redirectUri=http://localhost:8080/login/oauth2/code/kakao
spring.security.oauth2.client.registration.kakao.scope=profile_nickname, profile_image, account_email
spring.security.oauth2.client.registration.kakao.client-authentication-method=POST
spring.security.oauth2.client.registration.kakao.authorizationGrantType=authorization_code

🌮 ERROR Page

해당 application.properties 를 가지고

/oauth2/authorization/kakao

를 통해 OAuth로 로그인 하면 다음과 같은 에러가 발생했습니다.

🌮 ERROR

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Nov 14 16:36:58 KST 2023
There was an unexpected error (type=Internal Server Error, status=500).
This class supports `client_secret_basic`, `client_secret_post`, and `none` by default. Client [kakao] is using [POST] instead. Please use a supported client authentication method, or use `setRequestEntityConverter` to supply an instance that supports [POST].
java.lang.IllegalArgumentException: This class supports `client_secret_basic`, `client_secret_post`, and `none` by default. Client [kakao] is using [POST] instead. Please use a supported client authentication method, or use `setRequestEntityConverter` to supply an instance that supports [POST].

Client[KAKAO] 는 [POST] 대신 client_secret_post, client_secret_basic, none 이 제공된다고 합니다 .

🌭 AFTER

🌮 application.properties

# KAKAO
spring.security.oauth2.client.registration.kakao.client-id=[API ID]
spring.security.oauth2.client.registration.kakao.client-secret=[Secret key]
spring.security.oauth2.client.registration.kakao.redirectUri=http://localhost:8080/login/oauth2/code/kakao
spring.security.oauth2.client.registration.kakao.scope=profile_nickname, profile_image, account_email
spring.security.oauth2.client.registration.kakao.client-authentication-method=client_secret_post
spring.security.oauth2.client.registration.kakao.authorizationGrantType=authorization_code

🌮 After Page

before

spring.security.oauth2.client.registration.kakao.client-authentication-method=POST

After

spring.security.oauth2.client.registration.kakao.client-authentication-method=client_secret_post

정상적으로 작동하는 것을 확인할 수 있습니다.

0개의 댓글