@RequestMapping(value = "/authenticate", method = { RequestMethod.POST })
	@ResponseBody
	public String authorize(
			@RequestBody AuthenticationRequest authenticationRequest,
			HttpServletRequest request) {

		final UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
				authenticationRequest.getUsername(), authenticationRequest.getPassword());
		final Authentication authentication = this.authenticationManager.authenticate(token);
		SecurityContextHolder.getContext().setAuthentication(authentication);
		final HttpSession session = request.getSession(true);
		session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
				SecurityContextHolder.getContext());

		return session.getId();
	}
Controller responsible for handling web-logins as well as basic redirects for
for the admin-ui.

@author Gunnar Hillert
spring-xd-ui/src/main/java/org/springframework/xd/dirt/web/controller/LoginController.java