问题标签 [express-stormpath]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
388 浏览

node.js - 风暴路径快速会话注销不删除会话

我在我的 express 应用程序中使用了stormpath-express 和 express-session。登录部分工作正常。但是,当我注销时,以前的会话属性仍然存在于会话中。我可以看到会话属性 connect.sid 保持不变

我像这样调用/logout<button class="btn btn-default btn-default navbar-btn" onclick="$.post('/logout', function(data) {location.href='/'})">这是对/logout 的ajax POST 调用。

根据stormpath 文档,会话将被销毁。但是,当我使用其他用户登录时,之前的会话 cookie 仍然存在。

注销后,之前的会话属性仍然存在

0 投票
1 回答
77 浏览

swift - Can I show user data to other users in Stormpath?

I'm trying to integrate Stormpath to an iOS app (Swift), and would like to be able to show one user's data to another user.

In other words, can I show 1 user another user's information by searching my userlist for certain factors (such as age or geographic location) like I would be able to with mySQL?

Is this possible? I haven't been able to find documentation for this.

0 投票
1 回答
444 浏览

express - Stormpath 注销 URL 路由不起作用

我看到 /logout URL 的错误消息“Cannot GET /logout”,但从文档看来,该链接应该自动注册为路由。我的代码目前非常基本,如下所示:

任何帮助深表感谢。

0 投票
1 回答
883 浏览

angularjs - 如何在 angularjs 和 expressjs 应用程序中设置 withCredentials:false

我已经尝试了上述方法来设置 withCredentials:false。但不恢复任何更改。它总是需要 withCredentials:true。

因此我得到错误。”'XMLHttpRequest 无法加载“API url”。对预检请求的响应未通过访问控制检查:当凭据时,不能在“Access-Control-Allow-Origin”标头中使用通配符“*”标志为真。因此不允许访问源“ http://localhost:3000 ”。”

我也尝试过在 expressjs.Using cors() 中设置 withCredentials:false。但没有变化。

0 投票
1 回答
282 浏览

node.js - 一次调用创建 Stormpath 用户并分配给组

我想与组一起提交用户创建请求,但不确定如何在 express-stormpath 中执行此操作。

现在我使用注册前和注册后处理程序来获取一个字段,从 formData 中删除它,传递给 res,然后在注册后处理程序上设置组:

这似乎不是一个好主意。如果连接不可用并且组分配失败会怎样?用户可能会在没有组的情况下陷入困境。

0 投票
1 回答
600 浏览

node.js - 令牌无效或提供的状态令牌无效

所以我遇到了一个我怀疑我不应该遇到的问题,并且尝试了几件我似乎陷入僵局的事情。

我正在尝试将 LinkedIn 登录与 Stormpath 集成,并且似乎已创建帐户并且从技术上讲用户已登录,应用程序确实返回以下两个错误之一:“令牌无效”或“提供的状态令牌无效”。

我多次检查了我的 id 和 secret 以及授权的回调 url 等,但我不确定还能在哪里实际检查,我们将不胜感激。

为了进一步尝试,我实际上克隆了https://github.com/stormpath/stormpath-express-react-example并运行它,其他一切正常,但再次在这个应用程序上登录 LinkedIn 不起作用,所以我怀疑它不是我的代码(也许,经过多年的编码,我从来都不愿意说它不是我的代码,但你有它)。

我附上了截图,以防我现在非常疲惫的眼睛错过了什么。有人可以指出我的错误吗?

在此处输入图像描述在此处输入图像描述

0 投票
1 回答
112 浏览

javascript - Social login on registration page for Stormpath

I really hope this is my last question on the Stormpath API for a while. Making the switch from C# and PHP to node has been somewhat challenging.

I am trying to implement social login on the registration page. The pre-built option places it on the Login page only.

Rendering the page and adding elements to the Jade view is simple enough, but I need to get an oauthStateToken. Now I looked at how the login.js code does this:

So essentially it calls the oath files and goes through the code, theoretically, I could do something similar on register.js - essentially (just sample code):

But of course I wouldn't want to meddle with the core files, and was thinking about creating a middleware function, something like app.use('/register', callFunction, router); but I am having some difficulty in conceptualizing how that would work. I seem to understand how stormpath lets me generate an oauth token which I store as a cookie using JWT but I'm having a hard time putting it together into working code without replicating a lot of code already existent in the library.

I can even kinda of get it working by using the REST API but I would like to use it within the express-stormpath library. So some explanation in the context of express-stormpath library would also be enlightening. OR am I overthinking this, should I just fork the library, make the changes to register.js and try for a push upstream?

Thanks again folks,

0 投票
1 回答
116 浏览

javascript - 服务器端的 React-Stormpath

我想将 Stormpath 集成到我的 React 应用程序中。不幸的是,React-Stormpath 似乎只在客户端而不是在服务器端工作。我正在使用 React-Router 函数match来检查当前 url 是否有效(请参阅React Redux Universal Hot Example)。不幸的是,React Stormpath 只记录了使用它的Router组件。

你知道在我的 React-Redux 应用程序中也可以在服务器端实现 Stormpath 的可能性吗?

我仍然尝试使用matchReact-Stormpath 的功能,但它是未定义的。

先感谢您。

0 投票
2 回答
153 浏览

javascript - Stormpath-express 登录不适用于基本用户名:密码身份验证

我正在尝试为基于电子的桌面应用程序创建 NodeJS API 系统。该应用程序应允许使用用户名和密码进行基本登录,用户登录后,所有后续 API 调用都通过 id 和密钥进行身份验证。我在此处参考了有关使用 express-strompath 描述的指南。我无法像这样执行用户名/密码验证。

或通过 javascript

但是,当我使用 API 密钥时,我可以登录。

或通过 javascript

显然,让用户将他们的 API 密钥输入到表单中进行身份验证是不方便的。我想知道为什么stormpath-express 接受API ID/Secret 组合但不接受用户名/密码。

这是我的 nodejs 服务器的代码

和 Stormpath 设置代码

0 投票
1 回答
83 浏览

stormpath - 邮件验证后挂钩

在 express-stormpath 中,在成功的电子邮件验证后运行某些代码的最佳方式是什么?

postRegistrationHandler接近,但它在电子邮件验证之前被调用。