This week's book giveaway is in the Flex forum.
We're giving away four copies of Flex 4 in Action and have Tariq Ahmed, Dan Orlando, John C. Bland II & Joel Hooks on-line!
See this thread for details.
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » Security
 
RSS feed
 
New topic
Author

Create JAAS Subject

Smith Zac
Greenhorn

Joined: Jan 20, 2010
Messages: 2

Hello Everybody,
I would like to create a JAAS Subject through my java web application. Can some one please provide a sample code or a link where I could read more regd the steps required for the creation of a JAAS Subject in a Web Application . I will be deploying the application in a Webshere App Server. Any help would be greatly appreciated.

Thanks.
Smith.
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26740

Welcome to JavaRanch.

Normally you'd get the Subject from the LoginContext after a successful authentication; see http://java.sun.com/developer/JDCTechTips/2001/tt0727.html for an example. You'll need to configure WebSphere accordingly (meaning, it needs to be told where JAAS can find user information, whether in a DB, or LDAP, or elsewhere).

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Smith Zac
Greenhorn

Joined: Jan 20, 2010
Messages: 2

Hi Ulf,
I appreciate the response provided and also for the link. You are right, we need to go against the DB or LDAP. Basically I have created a custom Login Module and inside the login() method I was going against a DB to get the user Authenticated and finallay I was able to get a JAAS Subject created. But now I need to pass this JAAS Subject from one application to another application residing on a different App Server ? How can this be done. Any ideas ?

-Thanks.
Smith
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26740

That sounds like a single sigh-on (SSO) solution is called for. There was some discussion on this in http://www.coderanch.com/t/134584/Security/Understanding-JAAS-Web-app-SSO.

Java web chartsImageJ PluginsSpecification URLsJava FAQs
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » Security
 
RSS feed
 
New topic
The most intelligent Java IDE

.