Skip to content

Instantly share code, notes, and snippets.

@pubudu94
Created June 24, 2018 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pubudu94/8d56f931af38556877cc1e1261161be8 to your computer and use it in GitHub Desktop.
Save pubudu94/8d56f931af38556877cc1e1261161be8 to your computer and use it in GitHub Desktop.
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.security.Principal;
@RestController
@RequestMapping("/")
public class UserRestController {
@RequestMapping(value = "user", method = RequestMethod.GET)
public Principal user(Principal user) {
return user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment