Tag: express stormpath

401错误与发布请求Stormpath Express + React + Node + Gulp

尝试login任何用户时,出现以下POST错误结果: XMLHttpRequest cannot load https://api.stormpath.com/v1/applications/[APP_HREF]/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 401. 在我的server.js文件中,我提出了以下内容: var express = require('express'); var stormpath = require('express-stormpath'); var cors = require('cors'); var app = express(); app.use(stormpath.init(app, { apiKey: { id: 'xyz', secret: 'abc' // Using […]

Heroku Node Express Stormpath'API密钥ID和秘密是必需的'

我一直在关注Heroku Stormpath文档来设置一个简单的快速应用程序。 我的server.js文件中的代码如下所示: 'use strict'; var express = require('express'); var pg = require('pg'); var stormpath = require('express-stormpath'); var app = express(); app.use(express.static('public')); app.use(stormpath.init(app, { apiKeyFile: '/.stormpath/apiKey.properties', apiKeyId: process.env.STORMPATH_API_KEY_ID, apiKeySecret: process.env.STORMPATH_API_KEY_SECRET, secretKey: process.env.STORMPATH_SECRET_KEY, application: process.env.STORMPATH_URL, })); app.set('port', (process.env.PORT || 5000)); app.listen(app.get('port'), function(){ console.log('Node app is running on port', app.get('port')); }); 原谅我作为Stormpath的新手。 我也浏览了Express-Stormpath文档,但在本地运行应用程序时,我仍然收到以下错误消息: Node app is running […]