After some digging in, I have found a better approach. The much simpler way of disabling the authentication is by disabling authentication in AuthenticationServlet.
To acheive this DYNAMO_HOME/localconfig/atg/dynamo/servlet/adminpipeline/AuthenticationServlet.properties
file must have the content shown below.
$class=atg.servlet.pipeline.BasicAuthenticationPipelineServlet
enabled=false
Basic Authentication Pipeline Servlet is the class that is redirecting the authentication to other components, by changing enabled=false, we can disable the authentication. Changing it to true will enable the authentication as before.
Follow this link for more information: Disable DynAdmin authentication of Oracle Commerce