diff --git a/src/main/groovy/ee/ria/specificproxyservice/Requests.groovy b/src/main/groovy/ee/ria/specificproxyservice/Requests.groovy index 48d518b..ebe86fb 100644 --- a/src/main/groovy/ee/ria/specificproxyservice/Requests.groovy +++ b/src/main/groovy/ee/ria/specificproxyservice/Requests.groovy @@ -107,8 +107,8 @@ class Requests { return given() .filter(flow.cookieFilter) .filter(new AllureRestAssured()) - .cookie("__Host-oauth2_authentication_csrf_1316479801", flow.oauth2_authentication_csrf) - .cookie("__Host-oauth2_consent_csrf_1316479801", flow.oauth2_consent_csrf) + .cookie("__Host-ory_hydra_login_csrf_1316479801", flow.oauth2_authentication_csrf) + .cookie("__Host-ory_hydra_consent_csrf_1316479801", flow.oauth2_consent_csrf) .relaxedHTTPSValidation() .when() .redirects().follow(false) diff --git a/src/main/groovy/ee/ria/specificproxyservice/Steps.groovy b/src/main/groovy/ee/ria/specificproxyservice/Steps.groovy index 7d660c6..f6b001f 100644 --- a/src/main/groovy/ee/ria/specificproxyservice/Steps.groovy +++ b/src/main/groovy/ee/ria/specificproxyservice/Steps.groovy @@ -160,7 +160,7 @@ class Steps { Response authenticationResponse = Requests.startAuthenticationFlowInTara(flow, taraUrl) String location = authenticationResponse.then().extract().response().getHeader("location") - flow.setOauth2_authentication_csrf(authenticationResponse.getCookie("__Host-oauth2_authentication_csrf_1316479801")) + flow.setOauth2_authentication_csrf(authenticationResponse.getCookie("__Host-ory_hydra_login_csrf_1316479801")) URL locationUrl = new URL(location) String baseUrl = locationUrl.getProtocol() + "://" + (locationUrl.getPort() > 0 ? (":" + locationUrl.getPort()) : "") + locationUrl.getHost() flow.specificProxyService.setTaraBaseUrl(baseUrl) @@ -191,7 +191,7 @@ class Steps { @Step("User consents with authentication") static Response userConsentAndFollowRedirects(Flow flow, Response response) { Response response1 = Requests.followRedirectWithCsrfCookie(flow, response.getHeader("location")) - flow.setOauth2_consent_csrf(response1.getCookie("__Host-oauth2_consent_csrf_1316479801")) + flow.setOauth2_consent_csrf(response1.getCookie("__Host-ory_hydra_consent_csrf_1316479801")) Requests.followRedirect(flow, response1.getHeader("location")) Response response2 = Requests.consentSubmit(flow, flow.specificProxyService.taraBaseUrl + "/auth/consent/confirm", true) @@ -202,7 +202,7 @@ class Steps { @Step("User do not consent with authentication") static Response userDenyConsentAndFollowRedirects(Flow flow, Response response) { Response response1 = Requests.followRedirectWithCsrfCookie(flow, response.getHeader("location")) - flow.setOauth2_consent_csrf(response1.getCookie("__Host-oauth2_consent_csrf_1316479801")) + flow.setOauth2_consent_csrf(response1.getCookie("__Host-ory_hydra_consent_csrf_1316479801")) Requests.followRedirect(flow, response1.getHeader("location")) Response response2 = Requests.consentSubmit(flow, flow.specificProxyService.taraBaseUrl + "/auth/consent/confirm", false) diff --git a/src/test/groovy/ee/ria/specificproxyservice/UserConsentSpec.groovy b/src/test/groovy/ee/ria/specificproxyservice/UserConsentSpec.groovy index 661d06d..622c168 100644 --- a/src/test/groovy/ee/ria/specificproxyservice/UserConsentSpec.groovy +++ b/src/test/groovy/ee/ria/specificproxyservice/UserConsentSpec.groovy @@ -27,7 +27,7 @@ class UserConsentSpec extends SpecificProxyServiceSpecification { Response taraInitResponse = Steps.startAuthProcessInTara(flow, specificProxyResponse) Response response = Steps.authenticateWithMidAndFollowRedirects(flow, taraInitResponse) Response response2 = Requests.followRedirectWithCsrfCookie(flow, response.getHeader("location")) - flow.setOauth2_consent_csrf(response2.getCookie("__Host-oauth2_consent_csrf_1316479801")) + flow.setOauth2_consent_csrf(response2.getCookie("__Host-ory_hydra_consent_csrf_1316479801")) Response consentViewResponse = Requests.followRedirect(flow, response2.getHeader("location")) @@ -53,7 +53,7 @@ class UserConsentSpec extends SpecificProxyServiceSpecification { Response legalPersonSelectionResponse = Steps.selectLegalEntity(flow, getLegalEntityListResponse.body().jsonPath().get("legalPersons[0].legalPersonIdentifier")) String legalName = getLegalEntityListResponse.body().jsonPath().get("legalPersons[0].legalName") Response response2 = Requests.followRedirectWithCsrfCookie(flow, legalPersonSelectionResponse.getHeader("location")) - flow.setOauth2_consent_csrf(response2.getCookie("__Host-oauth2_consent_csrf_1316479801")) + flow.setOauth2_consent_csrf(response2.getCookie("__Host-ory_hydra_consent_csrf_1316479801")) Response consentViewResponse = Requests.followRedirect(flow, response2.getHeader("location"))