首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >StormPath获取无效的CORS请求错误

StormPath获取无效的CORS请求错误
EN

Stack Overflow用户
提问于 2016-12-06 21:41:03
回答 1查看 650关注 0票数 2

尝试将StormPath与接收多个错误的Spring集成。下面是应用程序设置。

使用stormpath-缺省-spring-启动程序版本1.2.1。

代码语言:javascript
复制
1) application.properties contains only stormpath id, secret and href as follows,

stormpath.client.apiKey.id = <id>
stormpath.client.apiKey.secret = <secret>
stormpath.application.href = <href>

2) SpringSecurityWebAppConfig.Java (Override spring security)

@Configuration
public class SpringSecurityWebAppConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.apply(stormpath());
    }
}

When application is run,
------------------------
1) http://localhost:8080/register renders register screen. 

2) http://localhost:8080/login (GET) throws error "Unable to invoke StormPath controller: Resolved account store cannot be an Organization".

3) http://localhost:8080/login (POST)  (from PostMan) throws error "Invalid CORS request".

感谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-06 22:19:55

对于您的问题#2,我们发布了SDK v1.2.2并修复了您现在面临的问题。当组织和/或组映射到应用程序时,会发生此问题。更新库版本将允许您呈现login页面。

至于#3,您有两个选项,要么禁用CORS筛选器stormpath.web.cors.enabled = false,要么将PostMap origin头添加到允许的originUris列表中,即stormpath.web.cors.allowed.originUris = <origin-header-value>

如果您想深入了解更多关于CORS的信息,您可能有兴趣查看Stormpath福音者的博客风暴路径下AngularJS和Spring的技巧和技巧文章。

希望这能帮上忙

何塞·路易斯

完全披露:我是风暴路径的工程师之一。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41005435

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档