봄 보안을 사용하려면이
public class AuthProviderImpl implements AuthenticationProvider
{
@Override
public Authentication authenticate(Authentication authentication)
throws AuthenticationException
{
WebServiceAuthClient client = //get an handle to your web service
//get user name, password from authenticate object
client.autheticat(username, pwd);
}
}
구성과 같은 웹 응용 프로그램을 몇 가지 일을 할 수 있고, 이것은 내가 의해 작동하는거야 것입니다 : http://static.springsource.org/spring-security/site/docs/3.0.x/reference/preauth.html
편집 : 우리의 상황 세션과 연관 쿠키에서
모든 외부 관리, 우리는 확인하고 기반으로 각 요청 권한을 부여해야합니다 외부 세션 저장소에서
그래서 우리는 대신 사용자 지정 SecurityContextRepository를 사용할 것입니다.
EDIT2 :
는 일반적인 토큰 저장소에 대해 각 요청을 확인하는 SecurityContextRepository를 작성하는 것은 봄 보안으로 배선, 미친 사소한이었다 : 보안의 context.xml의 HTTP 요소가 securityContextPersistenceFilter의 사용자 정의를 허용하지 않습니다, 그래서 나는 일반 콩으로 그것을 모방해야했다. 전혀 재미 있지 않습니다.
사용자 이름이나 암호가 없으므로 세션은 일종의 SSO로 사전 인증됩니다. 신속한 로그 아웃이 필요한 경우 각 요청은 토큰 저장소에 대해 유효성을 검사해야합니다. – Szocske