试图将StormPath与Spring Boot集成,接收多个错误。以下是应用程序设置。StormPath Spring Boot集成 - 获取无效的CORS请求错误
使用stormpath-default-spring-boot-starter版本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".
欣赏帮助。
#2通过升级到SDK v1.2.2得到解决,但#3仍然看到错误。在application.properties文件中添加了stormpath.web.cors.enabled = false,现在登录(POST)正在抛出“403,禁止,无消息”错误。谢谢! – Faizal
Hi @Faizal,很抱歉听说403响应,因为你使用PostMan响应是由存储的Cookie引起的,当LoginController看到已经通过认证的请求(存储的cookie)的登录尝试将拒绝请求与403.你可以尝试清理饼干和/或使用另一个客户端,如'curl'来确认这是你面临的问题?谢谢 – jbarrueta
curl我可以打Post URL但是不能用PostMan(清除cookies) – Faizal