0
嗨,我是laravel 4 begginer。Laravel 4 - Artadarek/OAuth-4-laravel問題
我嘗試使用Artadek/OAuth的4 laravel包 一切都使用的是什麼,我做了例子很順利,直到:
路線:
Route::get('lfb', array(
'as' => 'lfb',
'uses' => '[email protected]'
));
控制器:
class HomeController extends BaseController {
public function signInWithFacebook() {
// get data from input
$code = Input::get('code');
// get fb service
$fb = OAuth::consumer('Facebook');
// check if code is valid
// if code is provided get user data and sign in
if (!empty($code)) {
// This was a callback request from facebook, get the token
$token = $fb->requestAccessToken($code);
// Send a request with it
$result = json_decode($fb->request('/me'), true);
$message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];
echo $message. "<br/>";
//Var_dump
//display whole array().
dd($result);
}
// if not ask for permission first
else {
// get fb authorization
$url = $fb->getAuthorizationUri();
// return to facebook login url
return Redirect::to((string)$url);
}
}
和刀片:
@extends('layout.main')
@section('content')
<a href="{{ URL::route('lfb') }}">Sign in with Facebook</a>
@stop
從laravel.log
最後一個錯誤日誌:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
open: F:\wamp\www\IbidsLR\bootstrap\compiled.php
{
$routes = $this->get($request->getMethod());
$route = $this->check($routes, $request);
if (!is_null($route)) {
return $route->bind($request);
}
$this->checkForAlternateVerbs($request);
throw new NotFoundHttpException();
}
protected function checkForAlternateVerbs($request)
,我得到的時候按一下按鈕「哎呦,財產以後出了問題。」它將我重定向到lfb頁面,我沒有任何頁面調用該名稱我只是想使用fb登錄..
這裏有什麼錯?
感謝您的幫助,我現在打開調試到真正的,我已經與我的祕密身份證和應用程序ID的配置文件,我會更新我的問題與最新的錯誤,我得到也許你可以幫助我進一步的感謝。 – Ravg