Пример #1
0
 public function post_token()
 {
     $oA = new SebRenauld\OAuth2();
     $r = $oA->grantAccessToken(Input::all());
     if ($r instanceof Response) {
         return $r;
     }
     var_dump($r);
     die;
 }
Пример #2
0
    $i = Input::all();
    $r = $oA->finishClientAuthorization($i);
    return $r;
});
Route::get("/auth/authorize", function () {
    $oA = new SebRenauld\OAuth2();
    $i = Input::all();
    $r = $oA->getAuthorizeParams($i);
    if (!is_array($r)) {
        return $r;
    }
    return View::make("oauth2-sp::form", array("data" => $r));
});
Route::any("/auth/token", function () {
    $oA = new SebRenauld\OAuth2();
    $r = $oA->grantAccessToken(Input::all());
    if ($r instanceof Illuminate\Http\JsonResponse) {
        return $r;
    }
    if ($r instanceof SebRenauld\OAuth2\Models\Token) {
        return $r->printToken();
    }
});
/*
Route::post("/auth/token", function() {
	$oA = new SebRenauld\OAuth2();
	$r = $oA->grantAccessToken(Input::all());
	if ($r instanceof Response) {
		return $r;
	}
	if ($r instanceof SebRenauld\OAuth2\Models\Token) {