我正在使用SOCKET listenSocket = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket != INVALID_SOCKET)
{
BOOL off = FALSE;
setsockopt(listenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&off, sizeof(off));
sockaddr_in6 addr = {};
addr.sin6_family = AF_INET6;
addr.sin6_port = htons(7777);
addr.sin6_addr = in6addr_any;
bind(listenSocket, (sockaddr*) &addr, sizeof(addr));
listen(listenSocket, ...);
}
// use listening socket as needed...
以及vue.js
和laravel
,其文档可以找到here。
我的前端正在vue-authenticate
localhost:8080
上运行
127.0.0.1:8000
当我点击使用Vue.use(VueAuthenticate, {
baseUrl: 'http://127.0.0.1:8000', // Your API domain
providers: {
facebook: {
clientId: '123456789',
redirectUri: 'http://127.0.0.1:8000/facebook/callback', // Your client app URL
scope: ['email', 'rsvp_event', 'public_profile', 'user_events']
}
}
});
记录自己时出现此错误
客户端错误:
POST https://graph.facebook.com/v2.9/oauth/access_token
响应:{“error”:{“message”:“验证错误 验证码。请确保您的redirect_uri与之相同 你(截断...)
网址如下所示:
400
Bad Request
我该怎么做才能解决这个问题?
另外我不得不说我对回调函数有点困惑等等。我是否在适当的时候调用了正确的功能?
http://127.0.0.1:8000/facebook/callback?code=AQCio_tQpGgfBUKrdBRqIFDMS9NJvaFXX4hhnyFhKylIoTmU27ciMHBZiojdJT5XA2pApaPsoRO3ocokWrDx-TEBTSOmWQErkcmbOEi6fUYUPtlfJfiYw-49NyKYEDq63akgEqDI2r2FeBrw2Wo8IjlchNZ7F_IcAIyJjstVYShCZAK3Beu_rNEPG-1M6wvLHqXbe2dhRQcW9TeE2dxtewK-MPEb3ffmmoX5bK9uyZrF-TTH4tpsOKI2S6HPpDy2wSasUcXCtdMJfV3TLFuFlq1H3pgza6nyvhy8Ln1OQYbRTT30uBaZWnUt7R3JQsfAxzM#_=_
Route::get('auth/facebook', 'SocialAuthController@redirectToProviderApi');
Route::get('facebook/callback', 'SocialAuthController@handleProviderCallbackAPI');
答案 0 :(得分:0)
您的Facebook API redirect_uri
必须与您使用的API相同
http://127.0.0.1:8000/facebook/callback