• 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

Issues with Embedded Tomcat and Security Realm with Basic Authentication

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am in the process of upgrading our server from Tomcat 5.5 to Tomcat 7, and I am running into issues porting from the Embedded class to the Tomcat class. I am able to start the server successfully. When I try to access the secure realm, I am challenged with the basic authentication login dialog. If I enter the wrong credentials, I get a 401 and am presented the basic authentication login dialog. However, if I enter the correct credentials, I am presented with a 403 error. I figure that somehow, I didn't associate the user list with the secure realm, but I am not sure how to proceed. Can anyone provide any suggestions? Thanks in advance.

My code is attached below. FYI, the class OurTomcat extends the Tomcat class by providing a method to add a web app that uses the default web.xml. This is because our root app does not have a specific web.xml. However, the secure realm does have its own web.xml.

Howard
 
Howard Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue turned out to be the custom class I created to extend RealmBase to manage my user authentication and authorization. Because of my custom roles, I had to override the hasRole() method to reflect my role hierarchy. Thanks for looking.

Howard
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And thank you for sharing your solution, so others may benefit from it in the future
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to upgrade my Embedded Tomcat5 to Embedded tomcat 7.
Could you please share your full source code for the reference.
I am not getting many terms by refering above code.
It will be my pleasure if you share the source code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic