JBoss Community

Re: Custom 401 Error on Webservices (JBoss)

created by João Manuel in JBoss Web Services Development - View the full discussion

The Webservice use the JBoss Web component to authenticate the username and password (with Basic Authentication). (Note that i'm using JBoss-ESB)

 

For this motive, we need to change this jar (jbossweb.jar) in \jboss-esb\server\<server-name>\deploy\jbossweb.sar.

 

We must edit the file "ServerInfo.properties" (in org\apache\catalina\util\) and change the property "server.info=2.1.3.GA" to "server.info=XPTO".

 

Alternatively, it´s also possible to re-build this jar and replace the tag @VERSION@ to XPTO (in the task Ant, i believe).

 

During this analysis, was also identified the possible implementation of our BasicAuthenticator. Thus it is possible to configure the error message (401) so as to make it more configurable (ultimately we can return other error).

 

To do this, you must change the configuration

 

 

    <property name="authenticators">

    <..>

    <key>BASIC</key>

    <value> MyClass </value>

 

 

in file war-deployers-jboss-beans.xml (in \jboss-esb\server\<server-name>\deployers\jbossweb.deployer\META-INF).

Reply to this message by going to Community

Start a new discussion in JBoss Web Services Development at Community