Apache CFX를 사용하여 HP Quality Center에 REST 커넥터를 쓰고 있습니다. 서버 요청시 CFX 인프라를 사용하여 선점 인증을 수행하고 싶습니다.Apache CFX 기본 인증 HP Quality Center
HP Quality Center는 기본 기반 인증 메커니즘을 사용합니다. 인증을 위해 get 요청은 표준 기본 인증 헤더를 사용하여 http : /// qcbin/authentication-point/authenticate로 전송됩니다. 서버는 모든 후속 요청에 포함되어야하는 쿠키 ("LWSSO")를 반환합니다. 인증 전에 서버에서 자원을 요청하면 인증 지점 URI (예 : LWSSO 영역 = "http : // : 80/qcbin/authentication-point)가 포함 된 WWW-Authenticate 헤더가있는 401이됩니다.
이상적으로 말하면, 401 응답을 가로 채서 WWW-Authenticate 헤더를 구문 분석하고 모든 후속 요청에 대한 쿠키를 캐싱하기 전에 인증 포인트 URI에 대한 요청을 수행하여 인증을 처리하는 CFX HttpAuthProvider 또는 Interceptor를 만들려고합니다.
팩토리 패턴을 사용하여 깨끗한 프록시 기반 API를 만들 수 있습니다 (예 :
public QualityCenter create(String url, String username, String password) {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(url);
bean.setUsername(username);
bean.setPassword(password);
bean.setServiceClass(QualityCenter.class);
// TODO: Setup authentication modules here that use AuthPolicy for credentials.
return bean.create(QualityCenter.class);
}
)
나는 이것이 가능하고 기능을 구현하는 데 가장 적합한 곳인지 궁금하다.