From e4c7a2c991acba3ca6f3737432ab53ed6e0ac1d4 Mon Sep 17 00:00:00 2001 From: Benito Visone Date: Tue, 17 Sep 2024 14:25:12 +0200 Subject: [PATCH] feat: add pre-prod cie support (#316) * feat: add CIE pre-prod metadata * feat: add temporary entity id contains check to work with pre-prod environment. This will be removed with new idp retrieve modality * fix: add temporary idp sso endpoint filtering for HTTP-POST Binding * fix: add temporary idp sso endpoint filtering for HTTP-POST Binding in buildDestination * fix: add temporary fix in get credential for cie endpoint --- src/oneid/oneid-ecs-core/metadata/cie.xml | 346 ++++++++++-------- .../utils/MetadataResolverExtended.java | 8 +- .../service/utils/SAMLUtilsExtendedCore.java | 4 +- .../oneid/web/controller/OIDCController.java | 14 +- 4 files changed, 202 insertions(+), 170 deletions(-) diff --git a/src/oneid/oneid-ecs-core/metadata/cie.xml b/src/oneid/oneid-ecs-core/metadata/cie.xml index 577d8af8..1b9d4c87 100644 --- a/src/oneid/oneid-ecs-core/metadata/cie.xml +++ b/src/oneid/oneid-ecs-core/metadata/cie.xml @@ -1,60 +1,67 @@ - - - - - - - - - - -ssh7Qe/Sett1HNLh/vQYvNUkCjfgEhAg8Ce4f1GL+Mg= - - - -UI+4D9XebmPI96WgQAgSo+IrNzAObjecitjsR6l8gSYmtNDLNLYPeobF4kpFY34Y5bTm+IL1K9VN -hhnBeJBeuL9oSBee9PaDzCSt+hmrcQdKvAr05UWDsg96ZYkgyuDugcmbRl3+PBpHzheK0qnVGZne -BTSOrFk9vpYxrd2cHv/C6/DV6vNHJFe7uf2LE8yZ+qJqT/UKUgdS0qtW6FjdTOq44BxujJsi/1Yo -DiIMvDjKxNrWKjxgpra35i1D1iS6jAEG68nVHjFROQ0ciUS8+9JyoUvQJ3YkVdDAhnsrMtIE8w2A -RXL19GhWAw2wR8SKVEZeSNTkf34AQIHLx0vjiA== - - - - - -x62o94jkwiCC05Ts4nEhLhbdN5Cr0A6hlkXeaO7NVu0j9hLXE5oN8a6J/7G6yxC/3jFEFfwYs+ie -K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qpmzYS4TiBv + E6l9LlDITsmShVBpiLPU4IDdvoPPBlDqgotofCnSjQxRhGky7tiy+pBObo13lN6d + 03GgXNPZqZ+vKJinf8AmNe2UZ1ZbuvUtgS6+vx6P52/KNKx6YuDNmR3lLDhKZVDb + 2wwR5qfsdnJIAORbJVWd8kI6GGhmrsmha7zARd0W+ueDtd/WLuAg3G7QWRocHPlP + TN/dPUbKS4O0cnJx0M5UERQ12PIdy641ps6P1v2OatpfSmZp/IlDLKJj9O9V49LM + nxF3VBJkTep2UQsQUc3rlelN2rYAlhURQQzRwpWO5WJvAgMBAAGjgYwwgYkwHQYD + VR0OBBYEFAQDr+o8YMapC4lje9upfeiwmFdtMGgGA1UdEQRhMF+CImlkc2VydmVy + LnNlcnZpemljaWUuaW50ZXJuby5nb3YuaXSGOWh0dHBzOi8vaWRzZXJ2ZXIuc2Vy + dml6aWNpZS5pbnRlcm5vLmdvdi5pdC9pZHAvc2hpYmJvbGV0aDANBgkqhkiG9w0B + AQsFAAOCAQEAb7gRYzTPEMQjQKiwI4/NdhzzaoKQjp2tu3UPZwsUHruyCbI+B/0k + C2SaSBaAKGT66yN9bPY2Vj4FuxtYmLSZZnatydF19hSu+lExCySKt16GBJ+D5HN7 + OmVizRvJNE4+RF0bajpeXnMottLrcL5Ry/BivpxdnIQ9th2sMc7ev0IZtIGYCxGg + c5SAJCz4zuCcNiPANHDPdoxYEQ9EV9PNAUx8q9tjAhoRRiT2ovqT+Dowqax0AVOP + hRY5rA8WMccWAedO8iSSO8DTWomtoOKS9vjWrQxnsHaT8GXohC2OYgSdKsBchvjS + i1RIVkrqHoSHIK2XQapkl8YmD75JjrGNNA== + + - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -142,62 +163,63 @@ i1RIVkrqHoSHIK2XQapkl8YmD75JjrGNNA== - - -MIIDdTCCAl2gAwIBAgIUU79XEfveueyClDtLkqUlSPZ2o8owDQYJKoZIhvcNAQEL -BQAwLTErMCkGA1UEAwwiaWRzZXJ2ZXI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aWRzZXJ2ZXIuc2Vy + dml6aWNpZS5pbnRlcm5vLmdvdi5pdC9pZHAvc2hpYmJvbGV0aDANBgkqhkiG9w0B + AQsFAAOCAQEAb7gRYzTPEMQjQKiwI4/NdhzzaoKQjp2tu3UPZwsUHruyCbI+B/0k + C2SaSBaAKGT66yN9bPY2Vj4FuxtYmLSZZnatydF19hSu+lExCySKt16GBJ+D5HN7 + OmVizRvJNE4+RF0bajpeXnMottLrcL5Ry/BivpxdnIQ9th2sMc7ev0IZtIGYCxGg + c5SAJCz4zuCcNiPANHDPdoxYEQ9EV9PNAUx8q9tjAhoRRiT2ovqT+Dowqax0AVOP + hRY5rA8WMccWAedO8iSSO8DTWomtoOKS9vjWrQxnsHaT8GXohC2OYgSdKsBchvjS + i1RIVkrqHoSHIK2XQapkl8YmD75JjrGNNA== + + - + diff --git a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/MetadataResolverExtended.java b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/MetadataResolverExtended.java index b563cb9b..26d2452b 100644 --- a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/MetadataResolverExtended.java +++ b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/MetadataResolverExtended.java @@ -96,8 +96,8 @@ public Optional getCredential(String entityID) throws SAMLUtilsExcep Credential credential; try { - if (entityID.equals( - "https://idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO")) { + if (entityID.contains( + "idserver.servizicie.interno.gov.it")) { credential = cieMetadataCredentialResolver.resolveSingle(criteriaSet); } else { credential = spidMetadataCredentialResolver.resolveSingle(criteriaSet); @@ -120,8 +120,8 @@ public Optional getEntityDescriptor(String entityID) throws SA EntityDescriptor entityDescriptor; try { - if (entityID.equals( - "https://idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO")) { + if (entityID.contains( + "idserver.servizicie.interno.gov.it")) { entityDescriptor = cieMetadataResolver.resolveSingle(criteriaSet); } else { entityDescriptor = spidMetadataResolver.resolveSingle(criteriaSet); diff --git a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/SAMLUtilsExtendedCore.java b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/SAMLUtilsExtendedCore.java index 983d529f..b2dc2e98 100644 --- a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/SAMLUtilsExtendedCore.java +++ b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/service/utils/SAMLUtilsExtendedCore.java @@ -195,7 +195,9 @@ public Optional buildDestination(String idpID) throws SAMLUtilsException return getEntityDescriptor(idpID) .map(descriptor -> descriptor.getIDPSSODescriptor("urn:oasis:names:tc:SAML:2.0:protocol") .getSingleSignOnServices() - .getFirst() + .stream().filter( + singleSignOnService -> singleSignOnService.getBinding() + .equals("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST")).toList().getFirst() .getLocation() ); } diff --git a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/web/controller/OIDCController.java b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/web/controller/OIDCController.java index de7affbd..05f66cd9 100644 --- a/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/web/controller/OIDCController.java +++ b/src/oneid/oneid-ecs-core/src/main/java/it/pagopa/oneid/web/controller/OIDCController.java @@ -44,12 +44,14 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Base64; +import java.util.List; import java.util.Map; import java.util.Optional; import org.apache.commons.lang3.StringUtils; import org.opensaml.saml.saml2.core.Assertion; import org.opensaml.saml.saml2.core.AuthnRequest; import org.opensaml.saml.saml2.metadata.EntityDescriptor; +import org.opensaml.saml.saml2.metadata.SingleSignOnService; @Path(("/oidc")) public class OIDCController { @@ -187,9 +189,15 @@ private Response handleAuthorize( Client client = clientsMap.get(authorizationRequestDTOExtended.getClientId()); - // TODO is it correct to retrieve the 0 indexed? - String idpSSOEndpoint = idp.get().getIDPSSODescriptor("urn:oasis:names:tc:SAML:2.0:protocol") - .getSingleSignOnServices().getFirst().getLocation(); + // TODO rewrite it with new IDP Load metadata implementation + List singleSignOnServices = idp.get() + .getIDPSSODescriptor("urn:oasis:names:tc:SAML:2.0:protocol") + .getSingleSignOnServices(); + + String idpSSOEndpoint = singleSignOnServices.stream().filter( + singleSignOnService -> singleSignOnService.getBinding() + .equals("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST")).toList().getFirst() + .getLocation(); // 6. Create SAML Authn Request using SAMLServiceImpl