Route에서 값을 받았습니다>
dd($request->all());에서 code값을 받은 것을 확인했는데
아래 $kakaoUser = Socialite::driver(‘kakao’)->user();에서
localhost:8000/auth/callback 페이지 콘솔에서
Failed to load resource: the server responded with a status of 500 (Internal Server Error) 에러를 확인했습니다.
혹시 카카오 로그인 API를 사용할때 http는 카카오 로그인 api제공이 되지 않는 것인지 알고 싶습니다.
The error you’re encountering with Kakao Login API integration in Laravel 10 and PHP 8.2 could be due to several factors:
HTTPS Requirement:
Kakao API generally requires HTTPS for security purposes
However, you can use HTTP (localhost) for development/testing
Make sure your Kakao Developer Console settings have the correct redirect URI:
For local testing: http://localhost:8000/auth/callback
Include both HTTP and HTTPS versions if needed
To debug the 500 error, try this modified code:
php
Route::get(‘/auth/callback’, function (Request $request) {
try {
$kakaoUser = Socialite::driver(‘kakao’)->user();
dd($kakaoUser);
} catch (\Exception $e) {
dd($e->getMessage()); // This will show the actual error
}
});
Make sure the redirect URI in Kakao Developer Console matches exactly with your configuration
Clear Laravel’s configuration cache:
bash
php artisan config:clear
php artisan cache:clear
If you’re still getting the 500 error, you can check your Laravel logs (storage/logs/laravel.log) for more detailed error information. The issue is likely not related to using HTTP on localhost, as Kakao does allow HTTP for development purposes.
For production environments, you should always use HTTPS as it’s required for security reasons.
If your issue is not resolved, please provide more details and we will try to find a solution.