Answer the question
In order to leave comments, you need to log in
How to pass the name to the page, not the login?
<li><a href="/profile">${pageContext.request.userPrincipal.name}</a></li>
Answer the question
In order to leave comments, you need to log in
If we are talking about Spring Security, then
for this you need to override the UserDetailsService class, which will return, again, an overridden UserDetails with additional attributes. Then these attributes will be available.
An example of authorization through Active Directory - a bunch of different attributes are pulled out there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question