From 687b8de49114454bb8f2bfcedeb4a447af4178b3 Mon Sep 17 00:00:00 2001 From: sebdet Date: Mon, 26 Aug 2019 14:29:11 -0700 Subject: Fix the userInfo Fix user Info window, now clicking on the user name make it appears + attempt to add a logout Issue-ID: CLAMP-393 Change-Id: I82686a848f7ccae95c1eab22f1923a8821ba76b1 Signed-off-by: sebdet --- .../onap/clamp/clds/config/DefaultUserConfiguration.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java index a8ff12067..9d4e7d0c7 100644 --- a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java @@ -75,8 +75,10 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) { try { http.csrf().disable().httpBasic().and().authorizeRequests().antMatchers("/restservices/clds/v1/user/**") - .authenticated().anyRequest().permitAll().and().logout().and().sessionManagement().maximumSessions(1) - .and().invalidSessionUrl("/designer/timeout.html"); + .authenticated().anyRequest().permitAll().and().logout() + .logoutUrl("/restservices/clds/v1/user/logout").logoutSuccessUrl("/index.html") + .invalidateHttpSession(true).deleteCookies("JSESSIONID").and().sessionManagement() + .maximumSessions(1); } catch (Exception e) { logger.error(SETUP_WEB_USERS_EXCEPTION_MSG, e); @@ -105,7 +107,7 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { } for (CldsUser user : usersList) { auth.inMemoryAuthentication().withUser(user.getUser()).password(user.getPassword()) - .authorities(user.getPermissionsString()).and().passwordEncoder(passwordEncoder); + .authorities(user.getPermissionsString()).and().passwordEncoder(passwordEncoder); } } catch (Exception e) { logger.error(SETUP_WEB_USERS_EXCEPTION_MSG, e); @@ -118,8 +120,7 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { * CldsUser. * * @return The array of CldsUser - * @throws IOException - * In case of the file is not found + * @throws IOException In case of the file is not found */ private CldsUser[] loadUsers() throws IOException { logger.info("Load from clds-users.properties"); @@ -134,7 +135,7 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { return new BCryptPasswordEncoder(cldsBcryptEncoderStrength); } else { throw new CldsConfigException( - "Invalid clamp.config.security.encoder value. 'bcrypt' is the only option at this time."); + "Invalid clamp.config.security.encoder value. 'bcrypt' is the only option at this time."); } } } \ No newline at end of file -- cgit