Express 3.0 + Everyauth + HTTPS
我正在使用expression式3和everyauth为google oauth的nodejs。
实现如下所示:
everyauth.google /* snip */ .callbackPath('/loggedin'); var app = express(); app.configure(function(){ /* snip */ app.use(everyauth.middleware()); } var server = https.createServer(sslOptions, app); server.listen(app.get('port'), function(){ // ... });
现在,当我去到谷歌loginpath它说:
请求中的redirectURI:
http://localhost:4545/loggedin
与注册的redirectURI不匹配
这是正确的,因为我只在google api控制台中添加了httpS URI。
请注意,我正在使用HTTPS(secure!),并且由于某种原因,everyauth会用httpreplace我的url中的https。
我想这可能是因为我在app.use(everyauth.middleware());
之后创build了https服务器app.use(everyauth.middleware());
声明。 但是,如何重写代码,以便everyauth不会忽略https?
有没有移动app.use(everyauth.middleware());
的可能性app.use(everyauth.middleware());
在创buildhttps服务器之后的地方声明?
提前致谢!
我可以通过添加以下内容来解决Facebook上的这个问题auth:
everyauth.facebook.myHostname('https://www.example.com')
- 为什么我的节点expression.post被多次调用,而我的res.send()永远不会parsing$ http请求?
- Express中路由的URL生成
- 使用Knex使用当前时间戳更新表列
- 用Express,Node和Rest从AngularJS发布数据
- 当请求来自另一个域时,如何在sailsJS后端应用程序中坚持authentication状态?
- 我怎样才能在端口80上使用node.js服务单页html?
- 使用express.js和locomotive.js在中间件中添加api标记
- 护照js无法在跨网域中维护会话
- expressionjs错误:“明确反对res.sendfile:使用res.sendFile”