On Wed, 30 May 2001, you wrote:
> hi all,
> 
> I try to secure 8082 port.
> I followed the instruction provided by Vladimir Blagojevic couple weeks ago.
> http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg03359.html
> 
> I subclassed the HtmlAdaptorServer as follows:
... 
> I run the Jboss and no errors,however, I couldn't access the 8082
port (I > got "The page cannot be displayed" message)
>

Hi kadir,

I made the same experience, but still solved the problem:

try
1. subclass theH tmlAdaptorServer as follows:
public class SecureHtmlAdaptor extends HtmlAdaptorServer 
             implements SecureHtmlAdaptorMBean,
             MBeanRegistration,Serializable  { 
// nothing to implement here
 }

2. the important point is the interface SecureHtmlAdaptorMBean, defined
this way:
public interface SecureHtmlAdaptorMBean extends CommunicatorServerMBean {
    
    void addUserAuthenticationInfo(AuthInfo auth);
// this makes the method visible for the MBeanServer.invoke method
}

3. setting your jmx-administration accounts is done in another MBean:

public class HtmlAdaptorController implements HtmlAdaptorControllerMBean, 
MBeanRegistration,Serializable {
    private MBeanServer server;
    private ObjectInstance htmlAdaptor;
....
    public ObjectName preRegister(MBeanServer server, ObjectName name) {
        this.server = server;
        try {
            Set beans = server.queryMBeans( new ObjectName(
                            "Adaptor", "name", "html" ), null );
            if( !beans.isEmpty() ) { // Should be the first and only element
                this.htmlAdaptor = (ObjectInstance) beans.iterator().next();
            }
            return name;
        } catch (Exception e) {}
    } 

    public void start() {
        AuthInfo mAuthInfo =  new AuthInfo("test","test");
        try {
            this.server.invoke(
                               this.htmlAdaptor.getObjectName(),
                               "addUserAuthenticationInfo",
                               new Object[] { mAuthInfo },
                               new String[] { mAuthInfo.getClass().getName() }
                               );
        } catch (Exception e) {}
    }

with the definition of :
public interface HtmlAdaptorControllerMBean {

    void start();

}

4. and don't forget the entries in the jboss.jcml

if you like, you can get the user/password combination from a file, a
DB or whatever you like ;-)

hope it helps

tom

-- 
THETA - Consulting   
Kommuniktionsanalyse - Anwendungsentwicklung - LINUX-Systeme

Thomas Hagedorn                          Tel. 07231-472108
Rainstr. 12                              Tel. 0172-7642398
75217 Birkenfeld                         [EMAIL PROTECTED]

Jesus inside - where do you want to go forever ?

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to