File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/oneid/oneid-ecs-core/src
main/java/it/pagopa/oneid/web/controller
test/java/it/pagopa/oneid/web/controller Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ public Response samlACS(@BeanParam @Valid SAMLResponseDTO samlResponseDTO) {
9292 // in this case the raw SAMLResponse is stored in SAML record, but the flow is interrupted
9393 if (currentAuthDTO .isResponseWithMultipleSignatures ()) {
9494 Log .error ("SAML Response contains multiple signatures" );
95+ cloudWatchConnectorImpl .sendIDPErrorMetricData (
96+ samlSession .getAuthorizationRequestDTOExtended ().getIdp (),
97+ ErrorCode .IDP_ERROR_MULTIPLE_SAMLRESPONSE_SIGNATURES_PRESENT );
9598 throw new GenericHTMLException (ErrorCode .IDP_ERROR_MULTIPLE_SAMLRESPONSE_SIGNATURES_PRESENT );
9699 }
97100
Original file line number Diff line number Diff line change 2525import it .pagopa .oneid .service .SessionServiceImpl ;
2626import it .pagopa .oneid .web .controller .interceptors .CurrentAuthDTO ;
2727import it .pagopa .oneid .web .controller .mock .SAMLControllerTestProfile ;
28+ import it .pagopa .oneid .web .dto .AuthorizationRequestDTOExtended ;
2829import jakarta .inject .Inject ;
2930import java .net .URLEncoder ;
3031import java .nio .charset .StandardCharsets ;
@@ -433,9 +434,12 @@ void samlACS_SAMLResponseWithMultipleSignatures() {
433434 Response response = Mockito .mock (Response .class );
434435 Mockito .when (response .getInResponseTo ()).thenReturn ("Dummy" );
435436 Mockito .when (samlServiceImpl .getSAMLResponseFromString (Mockito .any ())).thenReturn (response );
437+ Mockito .when (mockAuthDTO .getResponse ()).thenReturn (response );
436438
439+ AuthorizationRequestDTOExtended dto = Mockito .mock (AuthorizationRequestDTOExtended .class );
440+ Mockito .when (dto .getIdp ()).thenReturn ("dummy-idp" ); // Stub idp for cloudwatch metrics
437441 SAMLSession samlSession = Mockito .mock (SAMLSession .class );
438- Mockito .when (mockAuthDTO . getResponse ()).thenReturn (response );
442+ Mockito .when (samlSession . getAuthorizationRequestDTOExtended ()).thenReturn (dto );
439443 Mockito .when (mockAuthDTO .getSamlSession ()).thenReturn (samlSession );
440444
441445 // HTTP 302
You can’t perform that action at this time.
0 commit comments