2017-03-09 82 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',如果您在示例中使用代碼。