Remove some logs

This commit is contained in:
Konstantinos Triantafyllou 2021-09-29 12:17:03 +03:00
parent 1e946f8609
commit 16ff047f4a
2 changed files with 0 additions and 5 deletions

View File

@ -7,7 +7,6 @@
<artifactId>dnet45-parent</artifactId> <artifactId>dnet45-parent</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<groupId>eu.dnetlib</groupId>
<artifactId>dnet-role-management</artifactId> <artifactId>dnet-role-management</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>

View File

@ -31,19 +31,15 @@ public class AuthoritiesUpdater extends HttpSessionSecurityContextRepository {
Map<String, ExpiringSession> map = sessions. Map<String, ExpiringSession> map = sessions.
findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, id); findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, id);
if (map != null) { if (map != null) {
logger.debug(map.values().toArray().length);
for (ExpiringSession session : map.values()) { for (ExpiringSession session : map.values()) {
logger.debug(session.getId());
if (!session.isExpired()) { if (!session.isExpired()) {
SecurityContext securityContext = session.getAttribute(SPRING_SECURITY_CONTEXT_KEY); SecurityContext securityContext = session.getAttribute(SPRING_SECURITY_CONTEXT_KEY);
Authentication authentication = securityContext.getAuthentication(); Authentication authentication = securityContext.getAuthentication();
if (authentication instanceof OIDCAuthenticationToken) { if (authentication instanceof OIDCAuthenticationToken) {
OIDCAuthenticationToken authOIDC = (OIDCAuthenticationToken) authentication; OIDCAuthenticationToken authOIDC = (OIDCAuthenticationToken) authentication;
logger.debug(authorities);
securityContext.setAuthentication(new OIDCAuthenticationToken(authOIDC.getSub(), authOIDC.getIssuer(), securityContext.setAuthentication(new OIDCAuthenticationToken(authOIDC.getSub(), authOIDC.getIssuer(),
authOIDC.getUserInfo(), authorities, authOIDC.getIdToken(), authOIDC.getUserInfo(), authorities, authOIDC.getIdToken(),
authOIDC.getAccessTokenValue(), authOIDC.getRefreshTokenValue())); authOIDC.getAccessTokenValue(), authOIDC.getRefreshTokenValue()));
logger.debug("Update authorities");
session.setAttribute(SPRING_SECURITY_CONTEXT_KEY, securityContext); session.setAttribute(SPRING_SECURITY_CONTEXT_KEY, securityContext);
sessions.save(session); sessions.save(session);
} }