Hi,
there are two levels to interpret your requirement.
(1) the easier one
You don't want the server to request basic auth
(2) the maybe harder one
You don't want the server to accept basic auth
The BPM REST API web module is configured to require basic auth in its web.xml. Consequently, when receiving an unauthenticated request for the REST API, WAS must return
HTTP 401 UNAUTHORIZED
www-authenticate: Basic ....
This will cause the browser pop up asking for username and password.
You can avoid this request for basic auth by overriding / customizing authentication in WAS using a Trust Association Interceptor (TAI):
https://www.ibm.com/docs/en/was-nd/8.5.5?topic=applications-developing-custom-taiThere are two important methods:
(a) isTargetInterceptor(): Should this TAI handle the request? This allows you to inspect the incoming request and fine tune to only jump in the few well-defined cases you want to handle. Here: request URI for REST API. Maybe, you even want to consider the user agent or host header to allow special treatment for some clients
(b) negotiateValidateandEstablishTrust(): handle the unauthenticated request. Most TAIs would return some cookie and redirect URL or some other type of challenge. In your use case, it may be good enough to just return TAIResult with HTTP 401 return code, but omit the www-authenticate header. This is what our product TAI does. In more recent versions of the product, you may observe a request parameter like avoidBasicAuthChallenge. This is an indicator for our own TAI to jump in and avoid the password prompt that browser side JS code cannot handle.
To meet your (2) requirment, you'd need to set some WAS security custom property to ensure your TAI is invoked even before WAS validates existing authentication (e.g. basic auth or LTPA). Your implementation would examine the request and in case there is a basic auth header - fail the request.
Unfortunately, when my blog post about this topic was archived, the sample code was lost...
------------------------------
Jens EngelkeJens Engelke
------------------------------
Original Message:
Sent: Wed October 20, 2021 11:05 AM
From: Joseph StClair
Subject: Disable Basic Authentication for inbound REST calls
I have been looking for an way to disable basic authentication for inbound REST calls to meet some security requirements. I don't want to disable portal basic auth just the ability to make a REST call using basic auth. We are running on 8.5.7 - WebSphere 8.5.5 - Thanks for the help.
------------------------------
Joseph StClair
President
BST Inc
Irving TX
2144495989
------------------------------