2017-03-09 81 views
0

美好的一天有没有人使用像这样的方法? https://laravel.com/docs/5.4/passport#client-credentials-grant-tokensLaravel护照client_credentials

我尽量让注册API已经CLIENT_ID只有client_secret和我想要的回报,作为访问令牌,令牌刷新,EXPIRE_DATE但 www.url.com/oauth/token的回报这

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

任何人都可以帮助我..? 在此先感谢

回答

2

我知道这是旧的,我不知道你是否得到它的工作。根据您对问题的描述,请求中可能缺少grant_type参数。您需要grant_type,client_idclient_secret。当我省略参数时,我得到相同的验证错误消息。如果您使用的是客户端凭据授权,则需要'grant_type' => 'client_credentials',如果您在示例中使用代码。