basic authorization header lost on https REST webservice

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

bartbaas
Ebase User
Posts: 32
Joined: Wed Jun 19, 2019 9:46 am

basic authorization header lost on https REST webservice

#1

Postby bartbaas » Tue Mar 15, 2022 10:49 am

Good morning,

We found out this morning that on a REST webservice resource, the header of basic authentication seems to be dropped in communication when using an https url.

We set up a REST webservice, and for the default endpoint we configured endpoint security as follows:
tab http-security, enable http authentication, type basic, set a username and password to &&username and &&password
(we set those dynamically, based on an environment variable)

The logging (debug checked) returns that we wish to authenticate through negotiation, which is the default behaviour when no authorization header is used:
HTTP/1.0 401 <html><head><title>Error</title></head><body>Unauthorized</body></html>
Strict-Transport-Security:max-age=15552000; includeSubDomains; preload&Cache-Control:no-cache, no-store, must-revalidate&Server:JBoss-EAP/7&WWW-Authenticate:Negotiate&Connection:keep-alive&Set-Cookie:NSC_JOcw2eu5doappvmeyuypkhc0v0trvcm=ffffffff092a3a5845525d5f4f58455e445a4a4229a0;Version=1;Max-Age=120;path=/;secure;httponly&Expires:0&Pragma:no-cache&Content-Length:71&Date:Tue, 15 Mar 2022 09:23:37 GMT&X-Powered-By:Undertow/1&Content-Type:text/html;charset=UTF-8

We confirmed this by using curl to do the same POST request. With header, good response, without, a 401 response like above.
Attachments
basic_auth_config.png
basic_auth_config.png (18.28 KiB) Viewed 2514 times
0 x

bartbaas
Ebase User
Posts: 32
Joined: Wed Jun 19, 2019 9:46 am

Re: basic authorization header lost on https REST webservice

#2

Postby bartbaas » Tue Mar 15, 2022 10:51 am

We managed a workaround for now by adding a Authorization header specifically, containing the same information
Attachments
basic_auth_hdr.png
basic_auth_hdr.png (3.6 KiB) Viewed 2513 times
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: basic authorization header lost on https REST webservice

#3

Postby Steve » Tue Mar 15, 2022 2:23 pm

Hi Bart,

It looks as though the REST resource does not do the negotiate part. I will add this to our bug system to be investigated.

Kind regards

Steve
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: basic authorization header lost on https REST webservice

#4

Postby Steve » Thu Mar 17, 2022 11:54 am

Hi Bart,

I think this might be an issue with Apache Http Client... We pass on all the authentication to that.

If you are using pre 5.10.2.. please add the following logger to log4j.xml:

<logger name="org.apache.http" additivity="false">
<level value="ALL" />
<appender-ref ref="SYSLOG"/>
</logger>

If you are using 5.10.2 please add the following logger to log4j2.xml:

<Logger name="org.apache.http" level="ALL" additivity="false">
<AppenderRef ref="Console" />
<AppenderRef ref="File" />
</Logger>

These files can be found in the following location:

Verjio-Install-Dir\UserData\Server\apps\ebase\ebaseConf

if you are using the embedded server in the studio:

C:\Users\<username>\Verjio\Studio\embeddedServer\app\ebaseConf

Restart the server and try again and then send snippet from the log to support@ebasetech.com :

The logs location is here:

Verjio-Install-Dir\UserData\Server\apps\ebase\logs

Kind regards

Steve
0 x

bartbaas
Ebase User
Posts: 32
Joined: Wed Jun 19, 2019 9:46 am

Re: basic authorization header lost on https REST webservice

#5

Postby bartbaas » Tue Mar 22, 2022 8:11 am

Thanks! I'll gather the logging and post it here.
0 x

bartbaas
Ebase User
Posts: 32
Joined: Wed Jun 19, 2019 9:46 am

Re: basic authorization header lost on https REST webservice

#6

Postby bartbaas » Tue Mar 22, 2022 8:52 am

Please find attached the logfile. It seems it tries basic authentication last, but fails.
I can't find any authorization header either.
0 x

bartbaas
Ebase User
Posts: 32
Joined: Wed Jun 19, 2019 9:46 am

Re: basic authorization header lost on https REST webservice

#7

Postby bartbaas » Tue Mar 22, 2022 9:04 am

Ah "The extension log is not allowed." as zip, then
Attachments
logfile_apache_http.zip
(2.15 KiB) Downloaded 164 times
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: basic authorization header lost on https REST webservice

#8

Postby Steve » Tue Mar 29, 2022 9:00 am

Hi Bart,

Thanks for the logs.. you are right. The Authorization header is no attempted after the WWW-Authenticate is returned.

I still think this is a bug with the Apache HttpClient we are using. But it could also be our implementation of the Basic Authentication .. as it just passes this onto HttpClient.

I will need to investigate further. But your workaround by explicitly setting the Authorize header would be the only short term fix for this.

Kind regards

Steve
0 x


Who is online

Users browsing this forum: No registered users and 43 guests