Revision 59908
Added by Katerina Iatropoulou over 3 years ago
OverviewServlet.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.usermanagement; |
2 | 2 |
|
3 | 3 |
import org.mitre.openid.connect.model.OIDCAuthenticationToken; |
4 |
import org.springframework.security.core.Authentication; |
|
4 | 5 |
import org.springframework.security.core.context.SecurityContextHolder; |
5 | 6 |
|
6 | 7 |
import javax.servlet.ServletException; |
... | ... | |
19 | 20 |
|
20 | 21 |
if (isAuthenticated) { |
21 | 22 |
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); |
23 |
|
|
22 | 24 |
StringBuilder name = new StringBuilder().append(authentication.getUserInfo().getGivenName().charAt(0)); |
23 | 25 |
name.append(authentication.getUserInfo().getFamilyName().charAt(0)); |
24 | 26 |
request.getSession().setAttribute("authenticated", isAuthenticated); |
Also available in: Unified diff
securing edit delete