2017-06-28 12 views
0

Laravel Passportの新機能で、公式のマニュアルがインストールされ、設定されています。Laravel 5.3パスポートが機能していません

public function register(){ 
    $password = Hash::make('demo'); 
    $user = DB::table('users')->insertGetId([ 
      'name'  => 'User', 
      'email' => '[email protected]', 
      'password' => $password, 
     ]); 

    // create oauth client 
    $oauth_client = \App\OauthClient::create([ 
     'user_id'    => $user, 
     'name'     => 'User', 
     'secret'     => base64_encode(hash_hmac('sha256',$password, 'secret', true)), 
     'password_client'  => 1, 
     'personal_access_client' => 0, 
     'redirect'    => '', 
     'revoked'    => 0, 
    ]); 

    $response = ['status'=>200,'message'=>'Successfully Registered']; 
    return $response; 

私は郵便配達throgh APIと私は、ユーザーを認証するためのhttp://localhost/passport/oauth/tokenルートと呼ばその後正常に登録

としての取得応答を実行します。しかし、それは動作しません。そのように戻って...

POSTDATA:

grant_type:password 
client_id :1 
client_secret:j7q0ky8chHQ0RHJFpWo4Lqn/hl7Z0ntzYeyzsXE9ULA= 
username:[email protected] 
password:demo 
scope: 

応答:

{ 
    "error": "invalid_request", 
    "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.", 
    "hint": "Check the `client_id` parameter" 
} 

答えて

0

それがないのparamsに体内に配置されていることを確認します。

関連する問題