users@jax-rpc.java.net

Re: Security

From: Eschini Renato <renato.eschini_at_TIN.IT>
Date: Wed, 04 Sep 2002 09:34:32 +0200

Aron,
this is the solution about my problem:

My role define in tomcat-user.xml
<user name="my_username" password="my_pasword" roles="my_role" />

My client auth properties on the stub
// Authentication
stub._setProperty(Stub.USERNAME_PROPERTY,"my_username");
stub._setProperty(Stub.PASSWORD_PROPERTY,"my_password");

My security constraint in web.xml
<!-- Define a Security Constraint on this Application -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>My WebServices</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>my_role</role-name>
        </auth-constraint>
    </security-constraint>

    <!-- Define the Login Configuration for this Application -->
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>MyWebServices Application</realm-name>
    </login-config>

Thanks again, now my web service is under test ;)

Ciao,
 Renato
--------------------------------------------------------
Renato Eschini
Synapsis S.r.l.
     in Computer Science

P.zza Dante, 19/20
57121 Livorno Italy
tel: +390586 426790
fax: +390586 443954
www.websynapsis.com

You can find me at
e-mail:r.eschini_at_websynapsis.com
msn account:r_eschini_at_hotmail.com
web:www.cli.di.unipi.it/~eschini
--------------------------------------------------------