Forum Discussion

socaltester's avatar
socaltester
Contributor
5 years ago
Solved

Basic Auth and Endpoint Explorer

I'm slightly embarassed to post this, but I'm currently stumped on the issue.

 

Question: What are the potential issues that would allow Endpoint Explorer to succeed when a test step for the same URI fails?

 

Basically, while using Endpoint Explorer I get a proper and successful response from an API that requires basic authentication while it fails in a test step. I was using Endpoint Explorer to troubleshoot the authentication issue at the time I succeeded in receiving a proper response message. The last thing I had configured, and I know this may seem odd, was Outgoing and Incoming WS-Security Configurations. I have even configured the Keystore, the Username and Password in the Request Properties, and the Auth Basic (Built-in) Authorization tab.

 

At the API level, I don't see the the basic Authentication creditials request, so I'm basically trying everything I can think of to authenticate. The keystore configuration was done as an earlier effort to automated the x.509 authentication, but was put on hold in favor of getting tests created over basic auth first.

 

(see below example URI and the responses I've gathered)

 

Example:

GET https://<FQDN>/otm-console/controllers/SelectZone/json

 

Fail Response using Test Step (redirect options "on"):

 

HTTP/1.1 200 OK
Date: Wed, 09 Oct 2019 21:54:45 GMT
Server: JBoss-EAP/7
Strict-Transport-Security: max-age=600
X-Powered-By: Undertow/1
X-Frame-Options: SAMEORIGIN
Accept-Ranges: bytes
Last-Modified: Sat, 05 Oct 2019 01:48:26 GMT
Content-Type: text/html
Content-Length: 2898
Access-Control-Allow-Origin: *
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive

<html style="min-width: 600px; overflow: initial">
<head>
<style id="antiClickjack">body{display:none !important;}</style>
</head>

 

<body style="min-width: 600px; overflow: initial">

<link rel="stylesheet" href="vendor/css/bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="css/welcome.css">

<script src="vendor/js/jquery.min.js" crossorigin="anonymous"></script>
<script src="vendor/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="login_config.js" crossorigin="anonymous"></script>
<script src="login.js" crossorigin="anonymous"></script>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>

<header>
<nav class="navbar navbar-default navbar-fixed-top jfd-nav-header">
<div class="header">
<div class="classBar"></div>
</div>
</nav>
</header>


<div class="container agreement-container">
<div class="agreement">
<p><h4><strong>TEXT</strong></h4></p>
<p>TEXT</p>
<ul>
<li>Text
<li>Text
<li>Text
<li>Text
<li>Text
</ul>

<div class="text-center">
<button class="btn btn-primary" onClick="window.open('welcome.html', '_self'); return false;">I Accept</button>
</div>
</div>
</div>

<div class="navbar navbar-default navbar-fixed-bottom">
<div class="classBar"></div>
</div>

</body>
</html>

 

Other Info Gathered:

If I insert a previously used JSESSIONID into the header the response is: 

HTTP/1.1 401 Unauthorized

Server=JBoss-EAP/7
Strict-Transport-Security=max-age=600
WWW-Authenticate=Basic realm="HAB"
X-Powered-By=Undertow/1
Content-Type=text/html;charset=UTF-8
Content-Length=114
Set-Cookie=JSESSIONID=abcdefghijklmnopqurtuvReadMe.avf-d-hab; path=/hab
Access-Control-Allow-Origin=

 

 

Success Response using Endpoint Explorer:

 

HTTP/1.1 200 OK
Date=Wed, 09 Oct 2019 21:53:05 GMT
Server=JBoss-EAP/7
Strict-Transport-Security=max-age=600
X-Powered-By=Undertow/1
Content-Type=application/json
Content-Length=343
Access-Control-Allow-Origin=*
Keep-Alive=timeout=15, max=97
Connection=Keep-Alive

{"page":1,"total":1,"records":2,"rows":[{"id":"ABC","cell":["ABC ","ABC","ABC_Default ","SQL ","POSTGRES ","ActiveMQSSL "," "," "]},{"id":"CDB","cell":["CDB ","CDB","CDB_Default ","SQL ","POSTGRES ","ActiveMQSSL "," "," "]}]}

 

What are the potential issues that would allow Endpoint Explorer to succeed when a test step for the same URI fails? If I use the "Create Test" option using Endpoint Explorer I receive the following SoapUI Error pop-up:

 

Could not get JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLException: General error: "java.lang.NullPointerException" [50000-197]

 

  • After attempting to create the test step via the End Point viewer and restarting ReadyAPI for the second time today my test step works. I just do not know why? Ugh.

2 Replies

  • After attempting to create the test step via the End Point viewer and restarting ReadyAPI for the second time today my test step works. I just do not know why? Ugh.

    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Hi socaltester,

       

      It's great to heat the issue resolved anyway. Please let us know if you face it again.

       

      In the meantime, I'll mark your reply as a solution as the topic doesn't require any investigation.