Kovah/laravel-socialite-oidc

Package does not work with Socialite stateless()

Open

#6 opened on 2025年8月19日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)PHP (13 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (24 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

When a nonce is used (I think it is used by default), it stores the nonce in a session() and retrieves it from the session(). However, when using the stateless() method of Laravel Socialite, the session() should not be used. https://laravel.com/docs/12.x/socialite#stateless-authentication

It currently throws the following error:

{
    "message": "Session store not set on request.",
    "exception": "RuntimeException",
    "file": "/home/laravel_app/vendor/laravel/framework/src/Illuminate/Http/Request.php",
    "line": 559,
    "trace": [
        {
            "file": "/home/laravel_app/vendor/kovah/laravel-socialite-oidc/src/Provider.php",
            "line": 200,
            "function": "session",
            "class": "Illuminate\\Http\\Request",
            "type": "->"
        },
        {
            "file": "/home/laravel_app/vendor/kovah/laravel-socialite-oidc/src/Provider.php",
            "line": 298,
            "function": "getCurrentNonce",
            "class": "SocialiteProviders\\OIDC\\Provider",
            "type": "->"
        },
        {
            "file": "/home/laravel_app/vendor/kovah/laravel-socialite-oidc/src/Provider.php",
            "line": 274,
            "function": "isInvalidNonce",
            "class": "SocialiteProviders\\OIDC\\Provider",
            "type": "->"
        },
        {
            "file": "/home/laravel_app/vendor/kovah/laravel-socialite-oidc/src/Provider.php",
            "line": 245,
            "function": "decodeJWT",
            "class": "SocialiteProviders\\OIDC\\Provider",
            "type": "->"
        },
        {
            "file": "/home/laravel_app/app/Http/Controllers/Auth/SocialiteController.php",
            "line": 63,
            "function": "user",
            "class": "SocialiteProviders\\OIDC\\Provider",
            "type": "->"
        },
        {
            "file": "/home/laravel_app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "callback_api",
            "class": "App\\Http\\Controllers\\Auth\\SocialiteController",
            "type": "->"
        }
   ]
}

コントリビューターガイド