0
我在嘗試構建Foursquare應用程序,並選擇了Everyauth模塊來實現身份驗證(與Foursquare連接)。Everyauth - 與Foursquare連接
,我發現了錯誤
Error: Step getAccessToken of `foursquare` module timed out.
用戶允許應用程序之後。以下是我正在使用的代碼:
var express = require('express'),
util = require('util'),
helper = require('./helper'),
settings = require('./settings').appSettings,
everyauth = require('everyauth');
everyauth.foursquare
.entryPath('/auth/foursquare')
.callbackPath('/auth/foursquare/callback');
//everyauth.everymodule.moduleTimeout(-1);
everyauth.foursquare
.appId(settings.appId)
.appSecret(settings.appSecret)
.findOrCreateUser(function (session, accessToken, accessTokenExtra, foursquareUserMetadata) {
util.inspect(arguments);
return {};
})
.redirectPath('/');
var app = express.createServer(
express.bodyParser()
, express.static(__dirname + "/public")
, express.favicon()
, express.cookieParser()
, express.session({ secret: '*****'})
, everyauth.middleware()
);
app.get('/', function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<html><head></head><body><a href="' + helper.getAuthUrl() + '">Connect with Foursquare</a></body></html>');
});
everyauth.helpExpress(app);
app.listen(4040);
「everyauth」示例是否適合您? – diewie 2012-04-23 12:08:09