title: How to find out the currently logged-in user in Spring Boot?
body: <p>In <a href="https://github.com/dsyer/spring-security-angular/blob/master/single/src/main/java/demo/UiApplication.java" rel="noreferrer">this Spring Boot application</a> there is a web service, which returns some data for a logged-in user:</p>
  
  <pre><code>@RequestMapping("/resource")
  public Map&lt;String, Object&gt; home() {
      Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
      model.put("id", UUID.randomUUID().toString());
      model.put("content", "Hello World");
      return model;
  }
  </code></pre>
  
  <p>Imagine, the return value of the method depends on what user is currently logged in.</p>
  
  <p>How can I find out, which user is logged in in that method?</p>