You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.7 KiB
69 lines
1.7 KiB
package com.fr.solution.plugin.auth.cas.core; |
|
|
|
import com.fr.fs.auth.AuthenticateObjectType; |
|
import com.fr.privilege.Authentication; |
|
import com.fr.stable.StringUtils; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
/** |
|
* Created by richie on 16/7/19. |
|
*/ |
|
public class CasAuthenticateObjectType implements AuthenticateObjectType { |
|
|
|
private static final String XML_TAG = "CasAuthenticateObjectType"; |
|
|
|
private String casUrl; |
|
|
|
public CasAuthenticateObjectType() { |
|
|
|
} |
|
|
|
@Override |
|
public boolean authentication(Authentication authentication) throws Exception { |
|
// richie:这里补充cas认证信息 |
|
return false; |
|
} |
|
|
|
@Override |
|
public boolean authenticationWithoutPassword() { |
|
return false; |
|
} |
|
|
|
public String getCasUrl() { |
|
return casUrl; |
|
} |
|
|
|
public void setCasUrl(String casUrl) { |
|
this.casUrl = casUrl; |
|
} |
|
|
|
@Override |
|
public String markType() { |
|
return CasConstants.MARK_TYPE; |
|
} |
|
|
|
@Override |
|
public Object clone() throws CloneNotSupportedException { |
|
CasAuthenticateObjectType cloned = (CasAuthenticateObjectType) super.clone(); |
|
cloned.casUrl = casUrl; |
|
return cloned; |
|
} |
|
|
|
@Override |
|
public void readXML(XMLableReader reader) { |
|
if (reader.isChildNode()) { |
|
String tagName = reader.getTagName(); |
|
if (XML_TAG.equals(tagName)) { |
|
casUrl = reader.getAttrAsString("url", StringUtils.EMPTY); |
|
} |
|
} |
|
} |
|
|
|
@Override |
|
public void writeXML(XMLPrintWriter writer) { |
|
writer.startTAG(XML_TAG); |
|
writer.attr("url", casUrl); |
|
writer.end(); |
|
} |
|
}
|
|
|