• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Minimal settings in web.xml to allow Authorization header to be manually processed?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm building an app using Apache CXF (JAX-RS), running in WebLogic 10.3.2.

I have a nice set of resource methods that work fine. I now need to implement some sort of authentication/authorization, but it will have to be managed by the application, not the container. I implemented a request handler in CXF that should allow me to look at the principal and credentials that were sent in the Authorization header. However, when I configured my test client to send a manually-constructed Authorization header (which I obtained from a tutorial on basic auth), my request got a 401 back without even getting into my application code on the server.

That tells me that I probably have to implement some of the "security"-related elements in my application's web.xml, although I just need to tell it to let everyone in, but give me the principal/credentials that were sent. I started the construct the "security-constraint" and "login-config" elements, but I'm not sure what minimal settings I need to get me past this obstacle.

I've started with the following, but I'm not sure what I need:

<security-constraint>
<web-resource-collection>
<web-resource-name>myapp</web-resource-name>
<url-pattern>/rest</url-pattern>
</web-resource-collection>
<auth-constraint>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
</login-config>
 
reply
    Bookmark Topic Watch Topic
  • New Topic