@@ -0,0 +1,2667 @@
+package com.github.solairerove.facepalm.security.controller;%0A%0Aimport com.github.solairerove.facepalm.security.JwtTokenUtil;%0Aimport com.github.solairerove.facepalm.security.model.jwt.JwtAuthenticationRequest;%0Aimport com.github.solairerove.facepalm.security.model.jwt.JwtAuthenticationResponse;%0Aimport lombok.RequiredArgsConstructor;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.beans.factory.annotation.Value;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.mobile.device.Device;%0Aimport org.springframework.security.authentication.AuthenticationManager;%0Aimport org.springframework.security.authentication.UsernamePasswordAuthenticationToken;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.AuthenticationException;%0Aimport org.springframework.security.core.context.SecurityContextHolder;%0Aimport org.springframework.security.core.userdetails.UserDetails;%0Aimport org.springframework.security.core.userdetails.UserDetailsService;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0A@RestController%0A@RequiredArgsConstructor(onConstructor = @__(@Autowired))%0Apublic class AuthenticationController %7B%0A%0A    @Value(%22$%7Bjwt.header%7D%22)%0A    private String tokenHeader;%0A%0A    private final AuthenticationManager authenticationManager;%0A%0A    private final JwtTokenUtil jwtTokenUtil;%0A%0A    private final UserDetailsService userDetailsService;%0A%0A    @RequestMapping(value = %22$%7Bjwt.route.authentication.path%7D%22, method = RequestMethod.POST)%0A    public ResponseEntity%3C?%3E createAuthenticationToken(@RequestBody JwtAuthenticationRequest authenticationRequest, Device device) throws AuthenticationException %7B%0A%0A        // Perform the security%0A        final Authentication authentication = authenticationManager.authenticate(%0A                new UsernamePasswordAuthenticationToken(%0A                        authenticationRequest.getUsername(),%0A                        authenticationRequest.getPassword()%0A                )%0A        );%0A        SecurityContextHolder.getContext().setAuthentication(authentication);%0A%0A        // Reload password post-security so we can generate token%0A        final UserDetails userDetails = userDetailsService.loadUserByUsername(authenticationRequest.getUsername());%0A        final String token = jwtTokenUtil.generateToken(userDetails, device);%0A%0A        // Return the token%0A        return ResponseEntity.ok(new JwtAuthenticationResponse(token));%0A    %7D%0A%7D%0A

create simple auth controller