@@ -667,15 +667,9 @@ Y_UNIT_TEST_SUITE(Mvp) {
667667
668668 TAutoPtr<IEventHandle> handle;
669669 NHttp::TEvHttpProxy::TEvHttpOutgoingResponse* outgoingResponseEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingResponse>(handle);
670- UNIT_ASSERT_STRINGS_EQUAL (outgoingResponseEv->Response ->Status , " 302" );
671- const NHttp::THeaders headers (outgoingResponseEv->Response ->Headers );
672- UNIT_ASSERT (headers.Has (" Location" ));
673- TString location = TString (headers.Get (" Location" ));
674- UNIT_ASSERT_STRING_CONTAINS (location, " https://auth.test.net/oauth/authorize" );
675- UNIT_ASSERT_STRING_CONTAINS (location, " response_type=code" );
676- UNIT_ASSERT_STRING_CONTAINS (location, " scope=openid" );
677- UNIT_ASSERT_STRING_CONTAINS (location, " client_id=" + settings.ClientId );
678- UNIT_ASSERT_STRING_CONTAINS (location, " redirect_uri=https://" + hostProxy + " /auth/callback" );
670+ UNIT_ASSERT_STRINGS_EQUAL (outgoingResponseEv->Response ->Status , " 400" );
671+ UNIT_ASSERT_STRING_CONTAINS (outgoingResponseEv->Response ->Body , " Unknown error has occurred. Please open the page again" );
672+
679673 }
680674
681675 Y_UNIT_TEST (OpenIdConnectotWrongStateAuthorizationFlow) {
@@ -784,22 +778,11 @@ Y_UNIT_TEST_SUITE(Mvp) {
784778 " Content-Length: " + ToString (authorizationServerResponse.length ()) + " \r\n\r\n " + authorizationServerResponse);
785779 runtime.Send (new IEventHandle (handle->Sender , edge, new NHttp::TEvHttpProxy::TEvHttpIncomingResponse (outgoingRequestEv->Request , incomingResponse)));
786780 auto outgoingResponseEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingResponse>(handle);
787- redirectStrategy.CheckRedirectStatus (outgoingResponseEv);
788- TString location = redirectStrategy.GetRedirectUrl (outgoingResponseEv);
789- UNIT_ASSERT_STRING_CONTAINS (location, " https://auth.test.net/oauth/authorize" );
790- UNIT_ASSERT_STRING_CONTAINS (location, " response_type=code" );
791- UNIT_ASSERT_STRING_CONTAINS (location, " scope=openid" );
792- UNIT_ASSERT_STRING_CONTAINS (location, " client_id=" + settings.ClientId );
793- UNIT_ASSERT_STRING_CONTAINS (location, " redirect_uri=https://oidcproxy.net/auth/callback" );
794-
795- NHttp::TUrlParameters urlParameters (location);
796- const TString newState = urlParameters[" state" ];
797-
798- NHttp::THeaders headers (outgoingResponseEv->Response ->Headers );
799- UNIT_ASSERT (headers.Has (" Set-Cookie" ));
800- const TStringBuf setCookie = headers.Get (" Set-Cookie" );
801- UNIT_ASSERT_STRING_CONTAINS (setCookie, CreateNameYdbOidcCookie (settings.ClientSecret , newState));
802- redirectStrategy.CheckSpecificHeaders (headers);
781+ UNIT_ASSERT_STRINGS_EQUAL (outgoingResponseEv->Response ->Status , " 302" );
782+ const NHttp::THeaders headers (outgoingResponseEv->Response ->Headers );
783+ UNIT_ASSERT (headers.Has (" Location" ));
784+ TStringBuf location = headers.Get (" Location" );
785+ UNIT_ASSERT_STRING_CONTAINS (location, " /requested/page" );
803786 }
804787
805788 Y_UNIT_TEST (OpenIdConnectSessionServiceCreateAccessTokenInvalid) {
0 commit comments