Cristoph,

I think the problem is that you are using the NONE role name.  This is
actually a jetty extension and not standard (as the standard say very very
little about any of this...)

With a role of NONE, the security handler does not insist that the user
is authenticated.   It was added so that strict constrainst could be
relaxed for specific URLs (see the README).    This is probably not
the best way to do this and we will be reviwing support for NONE
soon.

Eitherway, you do not want the semantics of NONE, you want the user
to be authenticated, but you do not care what group they are in.

Again, Jetty has an extension to the spec to support this.  All users
are in the role org.mortbay.http.User.   However this is implemented
in the HashUserRealm which is not used by JBoss.

So for now, you must define a role that all your JBoss users are in
and specify an AuthConstraint for that role.

Jetty needs to be changed so that the existance of an empty <auth-constraint>
element (ie no role specified) is sufficient to force authentication to
take place.

I will be doing this shortly for Jetty4, but is sounds like I should also
do this for a Jetty3 release as well.

cheers



>   */"Jung , Dr. Christoph" <[EMAIL PROTECTED]>/* wrote:
> 
>     Hello (Jules!),
> 
>     For the jboss.net SOAP-integration project, I just figured out the
>     principle how to combine Jetty&Axis security at least in the basic
>     authentication case (the others will then follow quite easily, I
>     think).
> 
>     In general, axis is deployed as a web-application into the
>     web-container, in our case we use Jetty3.1.5. For what I now try to
>     reach, I desperately need your help.
> 
>     As a default, I want to "secure" all exposed (EJB-based)
>     web-services under the context /axis/services (and hence hitting the
>     main AxisServlet) such that they are potentially open to everyone,
>     even to those without authentication (in which case they will have a
>     null security association). If the incoming XML/HTTP-calls use
>     authentication, however,  they should be logged in with their
>     corresponding principal in a pre-configurable security domain/realm
>     such that subsequently deserialized EJB calls will occur in the
>     right security context.
> 
>     My axis-web.xml currently contains:
> 
>      <!-- we add a security constraint -->
>      <security-constraint>
>        <!-- for every exposed service -->
>        <web-resource-collection>
>             <web-resource-name>Secured</web-resource-name>
>             <description>Authenticate every call</description>
>             <url-pattern>/services/*</url-pattern>
>             <http-method>HEAD</http-method>
>             <http-method>GET</http-method>
>             <http-method>POST</http-method>
>             <http-method>PUT</http-method>
>             <http-method>DELETE</http-method>
>        </web-resource-collection>
>       
>        <!-- we let through every user, authenticated or not. this is to
>             refine by specific service descriptors -->
> 
>        <auth-constraint>
>          <role-name>NONE</role-name>
>        </auth-constraint>
> 
>        <!-- no user data constraint here, this should be done for the
>     individual services -->
>      </security-constraint>
> 
>      <!-- we do BASIC authentication for now -->
>      <login-config>
>       <auth-method>BASIC</auth-method>
>       <realm-name>Axis basic authentication</realm-name>
>      </login-config>
> 
>     the corresponding jboss-web.xml looks like this:
> 
>     <jboss-web><security-domain>java:/jaas/other</security-domain></jboss-web>
> 
> 
>     Unfortunately, the Jetty3.1.5 Security Handler (line 291) either
>     does check authentication or
>     it ommits authentication completely ... So in above case, all users,
>     even those that come with
>     authentication data will not be logged in.
> 
>     // Does it fail a role check?
>                         if (sc.isAuthenticated() &&
>                             !sc.hasRole(SecurityConstraint.NONE) &&
>                            
>     !authenticatedInRole(pathInContext,pathParams,request,response,sc.roles()))
> 
>                             // return as an auth challenge will have
>     been set
>                             return;
>                       
>     Experimenting with an unauthenticatedPrincipal "nobody" in the
>     loginmodule instead of a NONE-role also did not work, because Jetty
>     then refuses
> 
>     any not-authenticated call having no credential information in the
>     request (SecurityHandler.java):
> 
>         private boolean basicAuthenticated(HttpRequest request,
>                                            HttpResponse response)
>             throws IOException
>         {
>             String credentials =
>                 request.getField(HttpFields.__Authorization);
>            
>             if (credentials!=null )
>             {
>             ...
>             }
>            
>             Code.debug("Unauthorized in "+_realmName);
>             response.setField(HttpFields.__WwwAuthenticate,
>                               "basic realm=\""+_realmName+'"');
>             response.sendError(HttpResponse.__401_Unauthorized);
>             return false;
>         }
>      
>     Is there another way to do it? Is my goal against the spec at all?
>     Does Jetty 4 do it exactly like this? Or do you think there is a
>     small potential to
> 
>     persuade Jetty to insert a reasonable null-credential against
>     login-module case?
> 
>     Thanks much,
>     CGJ ("Dr. Schorsch")
>     Currently spinnin� all-time soul classic: Omar, "Who chooses the
>     seasons"
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> *Do You Yahoo!?*
> Get personalised at My Yahoo! 
> <http://uk.rd.yahoo.com/mail_uk/my?http://uk.my.yahoo.com>.
> *Yahoo! Groups Sponsor*
> 
><http://us.a1.yimg.com/us.yimg.com/a/an/anchor/shopping/gloss/gel_ncs_fragrance_intution.jpg>
> 
> 
><http://rd.yahoo.com/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705375618:HM/A=889707/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?gloss2+shopping:dmad/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705375618:HM/A=889707/R=1/1012336098+http://us.rmi.yahoo.com/rmi/http://www.gloss.com/rmi-framed-url/http://www.gloss.com/module/EsteeLauder/templates/product/prod_multi.jhtml%3FmCategoryId=cat40207%26mktAdTrack=22000072>
> 
> ------------------------------------------------------------------------
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
> To alter your subscription to this list goto 
> http://groups.yahoo.com/group/jetty-discuss
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
> <http://docs.yahoo.com/info/terms/>.



-- 
Greg Wilkins<[EMAIL PROTECTED]>          GB  Phone: +44-(0)7092063462
Mort Bay Consulting Australia and UK.    Mbl Phone: +61-(0)4 17786631
http://www.mortbay.com                   AU  Phone: +61-(0)2 98107029


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to