Я использую код из этой статьи: http://www.javacodegeeks.com/2010/12/securing-gwt-apps-with-spring-security.html
В принципе, вы реализуете интерфейс Spring
org.springframework.security.authentication.AuthenticationProvider
, который имеет проверку подлинности (Authentication) метод. Вы получаете имя пользователя и пароль, введенный пользователем внутри этого метода с:
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, настройки фильтра Spring Security (см ссылку) и объявить 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 загружается. Для выхода из системы, просто сделать что-то вроде:
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();
}