From eedfbedc8c6dde00c4ccbd686755c56d1de0fe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Couralet?= Date: Thu, 25 Nov 2021 09:02:43 +0100 Subject: [PATCH] Fix logout URL for France Connect V2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Couralet --- src/main/resources/france-connect.properties | 4 +- ...anceConnectIdentityProviderConfigTest.java | 37 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/main/resources/france-connect.properties b/src/main/resources/france-connect.properties index 9e45779..dbd319f 100644 --- a/src/main/resources/france-connect.properties +++ b/src/main/resources/france-connect.properties @@ -11,7 +11,7 @@ france-connect.production.v1.logout.url=https://app.franceconnect.gouv.fr/api/v1 france-connect.integration.v2.authorization.url=https://auth.integ01.dev-franceconnect.fr/api/v2/authorize france-connect.integration.v2.token.url=https://auth.integ01.dev-franceconnect.fr/api/v2/token france-connect.integration.v2.userinfo.url=https://auth.integ01.dev-franceconnect.fr/api/v2/userinfo -france-connect.integration.v2.logout.url=https://auth.integ01.dev-franceconnect.fr/api/v2/logout +france-connect.integration.v2.logout.url=https://auth.integ01.dev-franceconnect.fr/api/v2/session/end france-connect.integration.v2.issuer.url=https://auth.integ01.dev-franceconnect.fr/api/v2 france-connect.integration.v2.jwks.url=https://auth.integ01.dev-franceconnect.fr/api/v2/jwks france-connect.integration.v2.use.jwks.url=true @@ -19,7 +19,7 @@ france-connect.integration.v2.use.jwks.url=true france-connect.production.v2.authorization.url=https://auth.franceconnect.gouv.fr/api/v2/authorize france-connect.production.v2.token.url=https://auth.franceconnect.gouv.fr/api/v2/token france-connect.production.v2.userinfo.url=https://auth.franceconnect.gouv.fr/api/v2/userinfo -france-connect.production.v2.logout.url=https://auth.franceconnect.gouv.fr/api/v2/logout +france-connect.production.v2.logout.url=https://auth.franceconnect.gouv.fr/api/v2/session/end france-connect.production.v2.issuer.url=https://auth.franceconnect.gouv.fr/api/v2 france-connect.production.v2.jwks.url=https://auth.franceconnect.gouv.fr/api/v2/jwks france-connect.production.v2.use.jwks.url=true diff --git a/src/test/java/fr/insee/keycloak/providers/franceconnect/FranceConnectIdentityProviderConfigTest.java b/src/test/java/fr/insee/keycloak/providers/franceconnect/FranceConnectIdentityProviderConfigTest.java index 1ab49c3..1e299fd 100644 --- a/src/test/java/fr/insee/keycloak/providers/franceconnect/FranceConnectIdentityProviderConfigTest.java +++ b/src/test/java/fr/insee/keycloak/providers/franceconnect/FranceConnectIdentityProviderConfigTest.java @@ -1,57 +1,56 @@ package fr.insee.keycloak.providers.franceconnect; -import fr.insee.keycloak.providers.common.EidasLevel; -import org.junit.jupiter.api.DisplayNameGeneration; -import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; -import org.junit.jupiter.api.Test; -import org.keycloak.models.RealmModel; - import static fr.insee.keycloak.providers.franceconnect.FCFixture.givenConfigForIntegrationV2AndEidasLevel2; import static fr.insee.keycloak.providers.franceconnect.FCFixture.givenConfigWithSelectedEnvAndSelectedEidasLevel; import static fr.insee.keycloak.providers.franceconnect.FranceConnectIdentityProviderFactory.FC_PROVIDER_MAPPERS; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import fr.insee.keycloak.providers.common.EidasLevel; +import org.junit.jupiter.api.DisplayNameGeneration; +import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; +import org.junit.jupiter.api.Test; +import org.keycloak.models.RealmModel; @DisplayNameGeneration(ReplaceUnderscores.class) class FranceConnectIdentityProviderConfigTest { @Test void should_initialize_config_with_selected_eidas_level_from_admin_interface() { - var config = givenConfigWithSelectedEnvAndSelectedEidasLevel( - "integration_v1", "eidas1" - ); + var config = givenConfigWithSelectedEnvAndSelectedEidasLevel("integration_v1", "eidas1"); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS1); - config = givenConfigWithSelectedEnvAndSelectedEidasLevel( - "integration_v1", "eidas2" - ); + config = givenConfigWithSelectedEnvAndSelectedEidasLevel("integration_v1", "eidas2"); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS2); - config = givenConfigWithSelectedEnvAndSelectedEidasLevel( - "integration_v1", "eidas3" - ); + config = givenConfigWithSelectedEnvAndSelectedEidasLevel("integration_v1", "eidas3"); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS3); } @Test - void should_initialize_config_with_url_properties_corresponding_to_selected_environment_from_admin_interface() { + void + should_initialize_config_with_url_properties_corresponding_to_selected_environment_from_admin_interface() { var config = givenConfigForIntegrationV2AndEidasLevel2(); assertThat(config.getAuthorizationUrl()).isNotNull().endsWith("/authorize"); assertThat(config.getTokenUrl()).isNotNull().endsWith("/token"); assertThat(config.getUserInfoUrl()).isNotNull().endsWith("/userinfo"); - assertThat(config.getLogoutUrl()).isNotNull().endsWith("/logout"); + assertThat(config.getLogoutUrl()).isNotNull().endsWith("/session/end"); assertThat(config.getIssuer()).isNotNull(); assertThat(config.isUseJwksUrl()).isTrue(); assertThat(config.getJwksUrl()).endsWith("/jwks"); } @Test - void should_initialize_config_with_selected_ignoreAbsentStateParameterLogout_from_admin_interface() { + void + should_initialize_config_with_selected_ignoreAbsentStateParameterLogout_from_admin_interface() { var config = givenConfigForIntegrationV2AndEidasLevel2(); assertThat(config.isIgnoreAbsentStateParameterLogout()).isFalse();