尝试将StormPath与接收多个错误的Spring集成。下面是应用程序设置。
使用stormpath-缺省-spring-启动程序版本1.2.1。
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".感谢你的帮助。
发布于 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的技巧和技巧文章。
希望这能帮上忙
何塞·路易斯
完全披露:我是风暴路径的工程师之一。
https://stackoverflow.com/questions/41005435
复制相似问题