- try {
- Authentication authentication = authenticationManager
- .authenticate(credentials);
- registerAuthentication(authentication);
- boolean res = super.login();
- // if (log.isDebugEnabled())
- // log.debug("User " + username + " logged in");
- return res;
- } catch (BadCredentialsException bce) {
- throw bce;
- } catch (Exception e) {
- LoginException loginException = new LoginException(
- "Bad credentials");
- loginException.initCause(e);
- throw loginException;
- }
+ // String url = urlCallback.getName();
+ // TODO: set it via system properties
+ String workspace = null;
+
+ SiteAuthenticationToken credentials = new SiteAuthenticationToken(
+ username, password, null, workspace);
+
+ // try {
+ Authentication authentication = authenticationManager
+ .authenticate(credentials);
+ registerAuthentication(authentication);
+ boolean res = super.login();
+ return res;
+ // } catch (BadCredentialsException bce) {
+ // throw bce;
+ // } catch (LoginException e) {
+ // // LoginException loginException = new LoginException(
+ // // "Bad credentials");
+ // // loginException.initCause(e);
+ // throw e;