Skip to content

Commit

Permalink
Merge pull request #97 from georchestra/logout-redirection
Browse files Browse the repository at this point in the history
Set logout redirection with oidc too
  • Loading branch information
f-necas authored Jan 23, 2024
2 parents 5f6b5d5 + 202c8ee commit 3b93d0d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.georchestra.gateway.security.ServerHttpSecurityCustomizer;
import org.georchestra.gateway.security.ldap.LdapConfigProperties;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -69,6 +70,8 @@
@Slf4j(topic = "org.georchestra.gateway.security.oauth2")
public class OAuth2Configuration {

private @Value("${georchestra.gateway.logoutUrl:/?logout}") String georchestraLogoutUrl;

public static final class OAuth2AuthenticationCustomizer implements ServerHttpSecurityCustomizer {

public @Override void customize(ServerHttpSecurity http) {
Expand Down Expand Up @@ -99,7 +102,7 @@ ServerLogoutSuccessHandler oidcLogoutSuccessHandler(

OidcClientInitiatedServerLogoutSuccessHandler oidcLogoutSuccessHandler = new OidcClientInitiatedServerLogoutSuccessHandler(
clientRegistrationRepository);
oidcLogoutSuccessHandler.setPostLogoutRedirectUri("{baseUrl}/login?logout");
oidcLogoutSuccessHandler.setPostLogoutRedirectUri("{baseUrl}" + georchestraLogoutUrl);
return oidcLogoutSuccessHandler;
}

Expand Down

0 comments on commit 3b93d0d

Please sign in to comment.