이 기사에서 코드를 사용하고 있습니다 : http://www.javacodegeeks.com/2010/12/securing-gwt-apps-with-spring-security.html
는 기본적으로, 당신은 인증합니다 (인증) 방법이있는 봄 인터페이스
org.springframework.security.authentication.AuthenticationProvider
를 구현합니다. 당신은 봄 보안의 필터 (링크 참조)를 구성
String username = (String) authentication.getPrincipal();
String password = (String) authentication.getCredentials();
// now try to get the user from your DB
User user = db.getUser(username, password);
하고 Spring 컨텍스트에서 당신의 AuthenticationProvider에 선언한다 : 당신은이 메소드 내에서 사용자가 입력 한 사용자 이름과 암호를 얻을
<bean id="authProvider" class="com.example.security.MyAuthenticationProvider" />
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="authProvider" />
</security:authentication-manager>
을 나는 GWT를 전혀 사용하지 않는다. 단지 일반 JSP 페이지이다. JSP 로긴 페이지 (그리고 로그 아웃 링크)의 예를 볼 수있다. here 사용자가 로그온하면, GWT app 로드되었습니다. 다음과 같이
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, "/j_spring_security_logout");
try {
rb.sendRequest(null, new RequestCallback() {
public void onResponseReceived(Request request, Response response) {
GWT.log("Logged user out: " + response.getStatusText());
}
public void onError(Request request, Throwable caught) {
// try to recover somehow
}
});
} catch (RequestException re) {
someOtherLogoutMechanism();
}