how to disable spring security authentication on just a few methods
I have spring basic authentication implemented, but there are a few urls
which I don't want to be authenticated. For example,
http://www.mywebsite.com/rest/signUp
How to I make this unauthenticated?
@Transactional
@RequestMapping(value = "/signUp", headers =
"Accept=application/json", produces =
MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
public @ResponseBody String signUp(@RequestParam("user_name") String
login,
@RequestParam("pass_word") String passWord,
@RequestParam("first_name") String firstName,
@RequestParam("last_name") String lastName,
@RequestParam("network_name") String networkName,
@RequestParam("email") String email) {
if(!userDAO.loginExists(login)) {
User user = new User();
user.setLogin(login);
user.setFirstName(firstName);
user.setLastName(lastName);
user.setNetworkName(networkName);
user.setEmail(email);
user.setPassword(passWord);
sessionFactory.getCurrentSession().save(user);
return json("success");
}
return json("failure");
}
No comments:
Post a Comment