/**
  * @return \Illuminate\Http\Response
  */
 public function postAccessToken(Request $request)
 {
     //Patch because the package doesn't support json body parameter, we have to do this
     $this->request->request->replace($request->all());
     //Replace the request instance into the authorizer
     $this->authorizer->setRequest($this->request);
     //Issue the access token
     return response()->json($this->authorizer->issueAccessToken());
 }
Esempio n. 2
0
 /**
  * Send the request after setting authorization params
  * @return Illuminate\Http\Response
  */
 public function sendAuthorization()
 {
     $this->request->merge($this->params->toArray());
     $this->oauth->getIssuer()->setRequest($this->request);
     $token = $this->oauth->issueAccessToken();
     if (auth()->check()) {
         $token['user'] = auth()->user();
     }
     return response()->json($token);
 }
Esempio n. 3
0
 /**
  * Issue an access token if the request parameters are valid.
  *
  * @return array a response object for the protocol in use
  * @static 
  */
 public static function issueAccessToken()
 {
     return \LucaDegasperi\OAuth2Server\Authorizer::issueAccessToken();
 }
Esempio n. 4
0
 /**
  * Exchange client authorization code with authorization token
  * @param  Authorizer $authorizer
  * @return json
  */
 public function postAccessToken(Authorizer $authorizer)
 {
     return response()->json($authorizer->issueAccessToken());
 }
 public function postAccessToken()
 {
     return $this->authorizer->issueAccessToken();
 }
Esempio n. 6
0
 /**
  * Get an access Token
  * @return Illuminate\Http\Response
  */
 public function postAccessToken()
 {
     return response()->json($this->oauth->issueAccessToken());
 }