Laravel 5.6 Passport driver not working in socket.io and gives unauthorized exception

后端 未结 1 1683
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 02:48

Below code was working perfectly when the driver was api. Then I created a new project and changed the driver to passport.

Now, I am always getting Error: Unauthoriz

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 03:28

    have you followed the passport documentation: https://laravel.com/docs/5.6/passport ?

    In order to get the OAuth authentication, you need more parameters in the body apart from the bearer token.

     {
            "grant_type":"password",
            "client_id":"CLIENT_ID",
            "client_secret":"YOUR_SECRET",
            "username":"USERNAME",
            "password":"PASSWORD",
            "scope":""
        }
    

    0 讨论(0)
提交回复
热议问题