Laravel 密码授予令牌

时间:2021-02-15 04:27:42

标签: laravel-passport

我想通过 laravel 密码授权令牌获取令牌,但出现以下错误。

{"error":"unsupported_grant_type","message":"The authorization grant type is not supported by the authorization server.","hint":"Check the `grant_type` parameter"}

我在这个网站上看到一些关于这个问题的帖子,但没有一个解决了我的问题。 我有一个包含 nameemailpassword 列的用户表。我以用户名发送电子邮件。

邮递员导出信息参数除外:

{
"item": [
    {
        "name": "webservice test",
        "event": [
            {
                "listen": "test",
                "script": {
                    "exec": [
                        ""
                    ],
                    "type": "text/javascript"
                }
            }
        ],
        "protocolProfileBehavior": {
            "disabledSystemHeaders": {
                "connection": true,
                "accept-encoding": true,
                "accept": true,
                "user-agent": true,
                "host": true,
                "content-type": true
            },
            "strictSSL": false
        },
        "request": {
            "auth": {
                "type": "noauth"
            },
            "method": "POST",
            "header": [
                {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                },
                {
                    "key": "Content-Length",
                    "value": "256555",
                    "type": "text",
                    "disabled": true
                }
            ],
            "body": {
                "mode": "formdata",
                "formdata": [
                    {
                        "key": "grant_type",
                        "value": "password",
                        "type": "text"
                    },
                    {
                        "key": "username",
                        "value": "test@yahoo.com",
                        "type": "text"
                    },
                    {
                        "key": "password",
                        "value": "e10adc3949ba59abbe56e057f20f883e",
                        "type": "text"
                    },
                    {
                        "key": "client_id",
                        "value": "2",
                        "type": "text"
                    },
                    {
                        "key": "client_secret",
                        "value": "sNDlZTsSv2hpEa9wke7ZluzucqPMZfG57T6xZsxh",
                        "type": "text"
                    },
                    {
                        "key": "scope",
                        "value": "*",
                        "type": "text"
                    },
                    {
                        "key": "",
                        "value": "",
                        "type": "text",
                        "disabled": true
                    }
                ],
                "options": {
                    "raw": {
                        "language": "json"
                    }
                }
            },
            "url": {
                "raw": "http://mywebsite.com/oauth/token",
                "protocol": "http",
                "host": [
                    "webservice",
                    "mabnacloud",
                    "com"
                ],
                "path": [
                    "oauth",
                    "token"
                ]
            }
        },
        "response": []
    }
    ]
}

0 个答案:

没有答案