[jboss-user] [JBoss Portal] - Re: problem about cas sso:DBIdentityLoginModule can not get

jsports do-not-reply at jboss.com
Mon Sep 1 02:31:32 EDT 2008


  | import javax.security.auth.login.LoginException;
  | import javax.security.jacc.PolicyContext;
  | import javax.servlet.http.HttpServletRequest;
  | import org.jboss.portal.identity.auth.DBIdentityLoginModule;
  | 
  | public class CRMDBIdentityLoginModule extends DBIdentityLoginModule {
  | 
  | 	@Override
  | 	protected boolean validatePassword(String inputPassword,
  | 			String expectedPassword) {
  | //		logger.info("inputPassword=="+inputPassword);
  | //		logger.info("expectedPassword=="+expectedPassword);
  | 		HttpServletRequest request = null;
  | 		try {
  | 			request = (HttpServletRequest) PolicyContext
  | 					.getContext("javax.servlet.http.HttpServletRequest");
  | 		} catch (Exception e) {
  | 			log.error(this, e);
  | 			throw new RuntimeException(e);
  | 		}
  | 		Object ssoSuccess = request.getAttribute("ssoSuccess");
  | //		logger.info("ssoSuccess=="+ssoSuccess);
  | 		if (ssoSuccess != null) {
  | 			return true;
  | 		}
  | 		return super.validatePassword(inputPassword, expectedPassword);
  | 	}
  |  
  | 
  | 	@Override
  | 	protected String createPasswordHash(String username, String password,
  | 			String arg2) throws LoginException {
  | 		return password;
  | 	} 
  | }
  | 

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

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



More information about the jboss-user mailing list