Kovah/laravel-socialite-oidc

Package does not work with Socialite stateless()

Open

#6 创建于 2025年8月19日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)PHP (13 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (24 star)
PR 合并指标
 (30 天内没有已合并 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": "->"
        }
   ]
}

贡献者指南