-1

尝试在 Ionic 应用程序中实现 Facebook OAuth 时出现错误。

这就是我的 POST 请求 url 的样子:

https://df-apiurl.com/api/v2/user/session?oauth_callback=true&service=facebook&code=**********&state=********

这是错误响应。相关部分可能是:

"message":"客户端错误:POST https://graph.facebook.com/oauth/access_token导致400 Bad Request响应:\n{"error":{"message":"验证验证码出错。请确保您的 redirect_uri 与您的相同(截断...)\n"

但这里是完整的错误信息,以防万一。

{"error":{"context":null,"message":"客户端错误:POST https://graph.facebook.com/oauth/access_token导致400 Bad Request响应:\n{"error":{"message":"验证验证码时出错。请确保您的 redirect_uri 与您的相同(截断...)\n","code":400,"trace" :["0 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object( GuzzleHttp\Psr7\Response))","1 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object( GuzzleHttp\Psr7\Response))","2 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object( GuzzleHttp\Psr7\Response), 数组)","3 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/TaskQueue.php(61): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()","4 /opt/ bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)","5 /opt/bitnami/apps/dreamfactory/htdocs/vendor /guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()","6 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php (266): GuzzleHttp\Promise\Promise->waitIfPending()","7 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise- >invokeWaitList()","8 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/promises/src/Promise.php(62):GuzzleHttp\Promise\Promise->waitIfPending()","9 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/guzzle/src/Client.php(129): GuzzleHttp\Promise\Promise->wait() ","10 /opt/bitnami/apps/dreamfactory/htdocs/vendor/guzzlehttp/guzzle/src/Client.php(87): GuzzleHttp\Client->request('post', 'https://graph.f ...', Array)","11 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/socialite/src/Two/FacebookProvider.php(77): GuzzleHttp\Client- >__call('post', Array)","12 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/socialite/src/Two/FacebookProvider.php(77): GuzzleHttp\Client->post(' https ://graph.f...', Array)","13 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/socialite/src/Two/AbstractProvider.php(202): Laravel\Socialite\Two\FacebookProvider->getAccessTokenResponse( 'AQB6vh4ZHq1oYQn...')","14 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-oauth/src/Services/BaseOAuthService.php(91): Laravel\Socialite\Two\AbstractProvider-> user()","15 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Resources/UserSessionResource.php(86): DreamFactory\Core\OAuth\Services\BaseOAuthService->handleOAuthCallback( )","16 [内部函数]:DreamFactory\Core\Resources\UserSessionResource->handlePOST()","17 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler .php(267): call_user_func(数组)","18 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(173): DreamFactory\Core\Components\RestHandler->processRequest()","19 /opt/ bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(220): DreamFactory\Core\Components\RestHandler->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), ' ')","20 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(168): DreamFactory\Core\Components\RestHandler->handleResource(Array)" ,"21 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Services/BaseRestService.php(74): DreamFactory\Core\Components\RestHandler->handleRequest(Object(DreamFactory\Core\ Utility\ServiceRequest), '会话')","22 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17036): DreamFactory\Core\Services\BaseRestService->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), 'session')" ,"23 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17008): DreamFactory\Http\Controllers\RestController->handleService('v2', 'user', 'session')", "24【内部函数】:DreamFactory\Http\Controllers\RestController->handlePOST('v2', 'user', 'session')","25 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled .php(9093): call_user_func_array(Array, Array)","26 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9155): Illuminate\Routing\Controller->callAction('handlePOST' , 大批)”,”27 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9135): Illuminate\Routing\ControllerDispatcher->call(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route ), 'handlePOST')","28 [内部函数]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","29 /opt/bitnami/apps/ dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","30 /opt/bitnami/apps/ dreamfactory/htdocs/bootstrap/cache/compiled.php(17209): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","31 [内部函数]: DreamFactory\ Http\Middleware\AccessCheck->句柄(对象(照明\Http\Request),对象(关闭))“,”,“32 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627):call_user_func_array(数组,数组)”, "33 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","34 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/ framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","35 [内部函数]: Illuminate\Routing\Pipeline->Illuminate\Routing \{closure}(Object(Illuminate\Http\Request))","36 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9612): call_user_func(Object(Closure), Object(Illuminate \Http\Request))","37 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9136): Illuminate\Pipeline\Pipeline->then(Object(Closure))","38 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9123): Illuminate\Routing\ControllerDispatcher ->callWithinStack(对象(DreamFactory\Http\Controllers\RestController),对象(Illuminate\Routing\Route),对象(Illuminate\Http\Request),'handlePOST')","39 /opt/bitnami/apps/dreamfactory/ htdocs/bootstrap/cache/compiled.php(8191): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'DreamFactory\\Ht...', 'handlePOST')","40 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8178): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request))", "41 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7892): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))","42 [内部函数]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","43 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing /Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","44 [内部函数]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object( Illuminate\Http\Request))","45 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9612): call_user_func(Object(Closure), Object(Illuminate\Http\Request))" "46 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7893):Illuminate\Pipeline\Pipeline->then(Object(Closure))","47 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7884): Illuminate\Routing\Router->runRouteWithinStack(Object (Illuminate\Routing\Route), Object(Illuminate\Http\Request))","48 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7874): Illuminate\Routing\Router-> dispatchToRoute(Object(Illuminate\Http\Request))","49 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2416): Illuminate\Routing\Router->dispatch(Object(Illuminate\ Http\Request))","50 [内部函数]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))","51 /opt/bitnami /apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52):call_user_func(Object(Closure), Object(Illuminate\Http\Request))","52 /opt/bitnami/apps/dreamfactory/htdocs/app/Http/Middleware/AuthCheck.php(178): Illuminate\Routing\Pipeline- >Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","53【内部函数】:DreamFactory\Http\Middleware\AuthCheck->handle(Object(Illuminate\Http\Request), Object(Closure ))","54 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627): call_user_func_array(Array, Array)","55 [内部函数]: Illuminate\Pipeline\Pipeline-> Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","56 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32) : call_user_func(对象(闭包), 对象(Illuminate\Http\Request))","57 /opt/bitnami/apps/dreamfactory/htdocs/vendor/barryvdh/laravel-cors/src/HandleCors.php(42): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\ Request))","58 [内部函数]: Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))","59 /opt/bitnami/apps/dreamfactory/htdocs/ bootstrap/cache/compiled.php(9627): call_user_func_array(Array, Array)","60 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) ","61 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) ","62 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17306):Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","63【内部函数】:DreamFactory\Http\Middleware\FirstUserCheck->handle(Object(Illuminate\Http\ Request), Object(Closure))","64 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627): call_user_func_array(Array, Array)","65 [内部函数]: Illuminate \Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","66 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/ Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","67 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(13076): 照亮\路由\管道->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","68【内部函数】:Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure) )","69 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627): call_user_func_array(Array, Array)","70 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate \Pipeline\{closure}(Object(Illuminate\Http\Request))","71 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","72 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(11622): Illuminate\Routing\Pipeline->Illuminate \路由\{闭包}(对象(照明\Http\Request))“,”73【内部函数】:Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))","74 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/编译的.php(9627): call_user_func_array(Array, Array)","75 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","76 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","77 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12815): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","78 【内部函数】:Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->句柄(对象(照明\Http\Request),对象(关闭))“,”,“79 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627):call_user_func_array(数组,数组)”, "80 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","81 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/ framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","82 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/ compiled.php(12752): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","83 [内部函数]: Illuminate\Cookie\Middleware\EncryptCookies->handle (对象(Illuminate\Http\Request), 对象(闭包))","84 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627): call_user_func_array(Array, Array)","85 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{关闭}(对象(Illuminate\Http\Request))“,”,“86 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32):call_user_func(对象(闭包),对象(Illuminate\Http\Request))“”,“87 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(3271):Illuminate\Routing\Pipeline->Illuminate\Routing\{闭包}(Object(Illuminate\Http\Request))","88 [内部函数]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))", “89 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9627):call_user_func_array(Array, Array)","90 [内部函数]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","91 /opt/bitnami/apps/ dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","92 [内部函数]: Illuminate\ Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","93 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9612): call_user_func(对象(闭包),对象(Illuminate\Http\Request))”,”94 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2363):Illuminate\Pipeline\Pipeline->then(对象(关闭))","95 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2347): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))","96 /opt/bitnami/apps/dreamfactory/htdocs/public/index.php(53): Illuminate \Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))","97 {main}"]}}

4

1 回答 1

1

我在这里的答案解决了我的问题:

http://community.dreamfactory.com/t/oauth-services-dont-work/2740

如果其他人遇到类似问题,请尝试在 dreamfactory OAuth 服务重定向 url 和 facebook 重定向 url 中添加以下内容:

http://my_domain/dreamfactory/dist/index.html?service=facebook

于 2016-07-05T14:03:49.560 回答