spring authenticationManager.authenticate(token)停止工作

时间:2016-12-15 03:08:53

标签: java spring spring-mvc authentication

System.out.println("=======");
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
                user.getEmail(), user.getPassword());

try {
    // 로그인
    System.out.println( authenticationManager.toString() );
    System.out.println(123123);
    Authentication auth = authenticationManager.authenticate(token);
    SecurityContextHolder.getContext().setAuthentication(auth);
    repository.saveContext(SecurityContextHolder.getContext(), request, response);

    response.setStatus(HttpServletResponse.SC_OK); 
    System.out.println("=======ok");
    //map.put("success", true);
    //map.put("returnUrl", getReturnUrl(request, response));
} catch (BadCredentialsException e) {
    e.printStackTrace();
    response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}

此代码在我的本地服务器上成功运行,但在OS服务器上它会停止。

  

org.springframework.security.authentication.ProviderManager@59f2fb2b   123123 org.springframework.security.authentication.UsernamePasswordAuthenticationToken@8cba1f58:校长:id@gmail.com;证书:[保护];认证:false;细节:null;没有授予任何权力

OS服务器赢得R2 2008 localserver win 2010

出了什么问题?

0 个答案:

没有答案