You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently while working under a corporate proxy (NTLM), a GET request I send to an API Endpoint keeps failing, and I can see 'WWE-Authenticate: Basic realm="Realm" ' in the response. Which makes me believe, the request is not using the basic auth I set in the request.
When I run exactly the same request, without the corporate proxy, I can get the expected response from the API.
Also, even through Postman or web browser, I can get the response expected while using the corporate proxy.
Currently this is the code used for setting up the proxy. Please note that in this test, we try to hit multiple endpoints of the same API, all of them are successful, except the one that requires Basic Auth. So, proxy does work.
ProxySpecification proxySpec = new ProxySpecification(proxyHost, proxyPort, proxyScheme).withAuth(username, password); RestAssured.proxy(proxySpec)
The Request sent is created like: //First Attempt //Have also tried passing the Proxy-Authorization in the header, also failed String auth = new String(Base64.encodeBase64(new String(authUser+":"+authPassword).getBytes())); auth = "Basic " + auth;
Hi,
Currently while working under a corporate proxy (NTLM), a GET request I send to an API Endpoint keeps failing, and I can see 'WWE-Authenticate: Basic realm="Realm" ' in the response. Which makes me believe, the request is not using the basic auth I set in the request.
When I run exactly the same request, without the corporate proxy, I can get the expected response from the API.
Also, even through Postman or web browser, I can get the response expected while using the corporate proxy.
Currently this is the code used for setting up the proxy. Please note that in this test, we try to hit multiple endpoints of the same API, all of them are successful, except the one that requires Basic Auth. So, proxy does work.
ProxySpecification proxySpec = new ProxySpecification(proxyHost, proxyPort, proxyScheme).withAuth(username, password); RestAssured.proxy(proxySpec)
The Request sent is created like:
//First Attempt
//Have also tried passing the Proxy-Authorization in the header, also failed
String auth = new String(Base64.encodeBase64(new String(authUser+":"+authPassword).getBytes())); auth = "Basic " + auth;
getRequest = apiUtils.getTokenRequest().headers("Accept", "application/vnd.app-" + VERSION_NAME + "+json","AppVersion", VERSION_NAME,"SESSIONID", sessionId,"CSRFToken", getCSRFToken(), "Authorization", auth).queryParam("param1",param1);
//Second Attempt
getRequest = apiUtils.getTokenRequest().auth().basic(authUser, authPassword).headers("Accept", "application/vnd.app-" + VERSION_NAME + "+json","AppVersion", VERSION_NAME,"SESSIONID", sessionId,"CSRFToken", getCSRFToken()).queryParam("param1",param1);
//Third Attempt
RestAssured.authentication = basic(authUser, authPassword);
getRequest = apiUtils.getTokenRequest().headers("Accept", "application/vnd.app-" + VERSION_NAME + "+json","AppVersion", VERSION_NAME,"SESSIONID", sessionId,"CSRFToken", getCSRFToken()).queryParam("param1",param1);
Please find attached the Postman response:
And the RestAssured response:
Any help would be greatly appreciated! If there is any other information needed, please don't hesitate to ask.
Thanks and Best Regards,
David Alejandro
The text was updated successfully, but these errors were encountered: