[jboss-user] [JBoss Portal] - Re: help needed in LDAP authentication in portal environ.

rammy1984 do-not-reply at jboss.com
Mon Feb 25 15:08:34 EST 2008


hi i followed the jboss docs ..... i was actually tryin to write to test case ..... but now i just deployed and found it is working cool :)

this is what iam doing in my code


LoginContext lc = new LoginContext("portal",
					new UsernamePasswordHandler("test", "test".toCharArray()));

UserModule module = (UserModule) new InitialContext().lookup("java:/portal/UserModule");
	        RoleModule roleModule =(RoleModule) new InitialContext().lookup("java:/portal/RoleModule");
	        UserProfileModule userProfileModule  = (UserProfileModule) new InitialContext().lookup("java:/portal/UserProfileModule");	
		    MembershipModule membershipModule= (MembershipModule) new InitialContext().lookup("java/portal/MembershipModule");

org.jboss.portal.identity.User userIdentity;		      
		      userIdentity = ( org.jboss.portal.identity.User) module.findUserByUserName("testUser");	
		      String gotFromLdap = userIdentity.getUserName();		      
		      userIdentity.updatePassword("xyxyyx");	

lc.logout();


now i have other questions cropping up........

1. In logincontext iam using "portal" but the problem is when iam building using maven all my tests are failing saying that no login is configured for "portal" ......

is there any other approach i can take ? or 
how can i use LdapExtLoginModule in here.....

i want to use this for its advanced search feature.....

do u have suggestions.... plz guide me in this 

BTW above code is working so anyone who wanted to have sample code for using Identity management API 's you can use this :)

thanks guyz.... but plz help me with above clarifications 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131978#4131978

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131978



More information about the jboss-user mailing list