title: Reference username after Spring LDAP Authentication
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/248562/when-using-spring-security-what-is-the-proper-way-to-obtain-current-username-i">When using Spring Security, what is the proper way to obtain current username (i.e. SecurityContext) information in a bean?</a><br>
    <a href="https://stackoverflow.com/questions/9317376/spring-security-how-to-retrieve-username">spring security how to retrieve username</a>  </p>
  </blockquote>
  
  
  
  <p>I use spring ldap to authenticate my web app,</p>
  
  <pre><code>&lt;ldap-server id="sss" port="389"
               url="ldap://ldap.example.com:389/ou=active,ou=employees,ou=people,o=example.com?uid?sub"/&gt;
  
  &lt;authentication-manager alias="authenticationManager"&gt;
      &lt;ldap-authentication-provider
              server-ref="sss"
              role-prefix="ROLE_"&gt;
      &lt;/ldap-authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>it works, but I don't know how to get the username filled in login page, because I want to display it on top of my page.</p>
  
  <p>Thanks.</p>