2016-12-06 7 views
2

여러 오류를 수신하는 스프링 부트로 StormPath를 통합하려고합니다. 다음은 응용 프로그램 설정입니다.StormPath 스프링 부트 통합 - 잘못된 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". 

감사합니다.

답변

5

문제 2 번에 대해 SDK v1.2.2을 출시하고 현재 직면 한 문제가 해결되었습니다. 조직 및/또는 그룹이 응용 프로그램에 매핑되면이 문제가 발생합니다. 라이브러리 버전을 업데이트하면 login 페이지를 렌더링 할 수 있습니다. 당신은 두 가지 옵션이 있습니다

# 3의 경우와 CORS가 stormpath.web.cors.enabled = false를 필터링하거나 허용 originUrisstormpath.web.cors.allowed.originUris = <origin-header-value> 목록에 PostMap origin 헤더를 추가 해제하는 중.

CORS에 대해 더 자세히 알고 싶으면 Stormpath Evangelists 중 한 곳의 블로그 Tips and Tricks for AngularJS and Spring Boot with Stormpath을 확인하는 것이 좋습니다. 이 도움이

희망,

호세 루이스

전체 공개 : 나는 Stormpath의 엔지니어 중 하나입니다.

+0

# 2는 SDK v1.2.2로 업그레이드했지만 # 3은 여전히 ​​오류가 발생했습니다. application.properties 파일에 stormpath.web.cors.enabled = false가 추가되었습니다. 이제 로그인 (POST)에서 "403, 금지됨, 사용 가능한 메시지 없음"오류가 발생합니다. 감사! – Faizal

+0

안녕하세요 @Faizal, 403 답변을 듣고 죄송합니다. PostMan을 사용하고 있기 때문에 응답은 저장된 쿠키로 인해 발생합니다. 'LoginController'가 이미 인증 된 요청 (저장된 쿠키)에 대한 로그인 시도가 요청을 거부하면 403. 쿠키를 청소하거나 '컬 (curl)'과 같은 다른 클라이언트를 사용하여 문제를 해결할 수 있습니까? 고마워요 – jbarrueta

+0

곱슬 곱슬하게 나는 PostMan (쿠키를 지웠다)와 함께 Post URL을 치지 못했습니다. – Faizal

관련 문제