aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Single Sign-on across web-apps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Single Sign-on across web-apps" Watch "Single Sign-on across web-apps" New topic
Author

Single Sign-on across web-apps

John Brosan
Greenhorn

Joined: Jul 07, 2005
Posts: 9
Hello everyone,

I am using JBoss 4.0.2 w/Tomcat 5.5.9 (integrated) along with jTDS and SQLServer for a project.

I would like to use DatabaseServerLoginModule and single sign-on. I've created the approprite tables in my database for users and roles. I've created simple jsp pages for login and login error. I've also modified my login-config.xml, jboss-web.xml and web.xml to handle the security. I am using the Tomcat valve for singlesignon.

However, when I test the protected resource with a valid userid and password, I get a 403 error message. If I try to login with an invalid userid and password, I get the error jsp that I created.

This tells me that I am authenticating the user, but I am probably screwing something up with the roles as I cannot get access to the restricted resource even with the correct userid and password.

What I am trying to accomplish is

1. Authenticate a user against the database tables for userid and appropriate roles.

2. Use a custom error page when the user does not have access to the resource. Uid/pw combo AND role

3. Use SSO across the various web-apps that will comprise this project. Is it possible or correct for one web-app to handle all of the login/logout processing? If a user tries to access a web-app can that web-app redirect the user to a login page in another web-app? All of these web-apps will be in the same container.

Any help that could be provided, would be most appreciated.

Thanks,
Howler


Here is my stuff

web.xml



login-config.xml



jboss-web.xml

[ July 07, 2005: Message edited by: Howler ]

Linux, giving you more uptime than an overdose of viagra!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

"Howler"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
John Brosan
Greenhorn

Joined: Jul 07, 2005
Posts: 9
Sorry about that Mark.

All set now. :-)
John Brosan
Greenhorn

Joined: Jul 07, 2005
Posts: 9
Well,

I added the following to my log4j.xml file to get logging information.



After checking server.log I see that it looks like I'm getting authenticated and the correct role is being picked up. I'm still not sure why I am getting 403'd on my resource if I've got all of the information and assigned the correct role to the resource.



[ July 07, 2005: Message edited by: John Brosan ]

[ July 07, 2005: Message edited by: John Brosan ]

[ July 07, 2005: Message edited by: John Brosan ]
[ July 07, 2005: Message edited by: John Brosan ]
John Brosan
Greenhorn

Joined: Jul 07, 2005
Posts: 9
Well, after much pounding of my head during the last few days, I actually found a solution.

As it turns out, I needed to remove the security role tag from the web.xml file and place an '*' into the role-name tag.

It's currently my assumption, that once the user is authenticated, the code would check the user's roles to make sure they could have access to the application.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Single Sign-on across web-apps