java - spring security manual login -
i using spring security , want login users manually.
my controller looks this:
@requestmapping("/login") public string login() { authentication authenticationresult = authenticationmanager.authenticate(new usernamepasswordauthenticationtoken("user2", "password")); securitycontextholder.getcontext().setauthentication(authenticationresult); return "redirect:/"; } i found example in docs such login made.
i wanted ask whether there downsides or security issues approach?
edit: if can point me class (&docs?) default spring /login request ist handled might answer question how login process implemented spring internally
this work around when need process before user logs in. actual problem comes when following things. of course these not problems :-).
- if using spring remember-me token or custom authentication providers.
- when using encrypted passwords in db.
Comments
Post a Comment