package com.jama.credentials;
import org.jasig.cas.authentication.principal.Credentials;
public class LoginInfoCredentials
implements Credentials
{
private String account;
private String password;
private String randCode;
public LoginInfoCredentials()
{
}
public String getAccount()
{
return account;
}
public void setAccount(String account)
{
this.account = account;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getRandCode()
{
return randCode;
}
public void setRandCode(String randCode)
{
this.randCode = randCode;
}
}
package com.jama.credentials;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jasig.cas.authentication.principal.*;
// Referenced classes of package com.jama.credentials:
// LoginInfoCredentials
public class LoginInfoToPrincipalResolver
implements CredentialsToPrincipalResolver
{
private final Log log = LogFactory.getLog(getClass());
public LoginInfoToPrincipalResolver()
{
}
public Principal resolvePrincipal(Credentials credentials)
{
LoginInfoCredentials loginInfo = (LoginInfoCredentials)credentials;
if(log.isDebugEnabled())
{
log.debug((new StringBuilder("Creating SimplePrincipal for [")).append(loginInfo.getAccount()).append("]").toString());
}
return new SimplePrincipal(loginInfo.getAccount());
}
public boolean supports(Credentials credentials)
{
return credentials != null && com/jama/credentials/LoginInfoCredentials.isAssignableFrom(credentials.getClass());
}
}
posted on 2006-12-08 13:48
robbin163 阅读(266)
评论(0) 编辑 收藏