Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…wt-api-gateway into update_main_who

� Conflicts:
�	pom.xml
�	src/main/java/edu/stanford/protege/webprotege/gateway/KeycloakLogoutHandler.java
�	src/main/java/edu/stanford/protege/webprotege/gateway/SecurityConfig.java
  • Loading branch information
soimugeo committed Jul 2, 2024
2 parents eb32d3f + 3d8f741 commit 4fc9952
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public KeycloakLogoutHandler() {
public void logout(HttpServletRequest request, HttpServletResponse response,
Authentication auth) {
logoutFromKeycloak((Jwt) auth.getPrincipal());
super.logout(request, response,auth);
super.logout(request, response, auth);
}

private void logoutFromKeycloak(Jwt token) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
package edu.stanford.protege.webprotege.gateway;

import org.springframework.context.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
import org.springframework.security.core.session.SessionRegistryImpl;
import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter;
import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority;
import org.springframework.security.oauth2.core.user.OAuth2UserAuthority;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.access.intercept.AuthorizationFilter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.session.*;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;

import java.util.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -61,7 +71,7 @@ public SecurityFilterChain resourceServerFilterChain(HttpSecurity http) throws E
.jwt(Customizer.withDefaults()));
http.oauth2Login(Customizer.withDefaults())
.logout(AbstractHttpConfigurer::disable);

return http.build();
}

Expand Down

0 comments on commit 4fc9952

Please sign in to comment.