use of com.sun.identity.console.federation.IDFFAuthContexts in project OpenAM by OpenRock.
the class IDFFModelImpl method getSPAuthenticationContexts.
/**
* Returns the object of Auththentication Contexts in SP.
*
* @param realm Realm of Entity
* @param entityName Name of Entity Descriptor.
* @return attributes values of provider.
*/
public IDFFAuthContexts getSPAuthenticationContexts(String realm, String entityName) throws AMConsoleException {
IDFFAuthContexts cxt = new IDFFAuthContexts();
String str = null;
try {
List tmpList = new ArrayList();
IDFFMetaManager manager = getIDFFMetaManager();
Map map = new HashMap();
BaseConfigType spConfig = manager.getSPDescriptorConfig(realm, entityName);
if (spConfig != null) {
map = IDFFMetaUtils.getAttributes(spConfig);
} else {
throw new AMConsoleException("invalid.entity.name");
}
List list = (List) map.get(ATTR_SP_AUTHN_CONTEXT_MAPPING);
for (int i = 0; i < list.size(); i++) {
String tmp = (String) list.get(i);
int index = tmp.lastIndexOf("|");
String level = removeKey(tmp.substring(index + 1));
String name = removeKey(tmp.substring(0, index));
cxt.put(name, "true", level);
}
} catch (IDFFMetaException e) {
throw new AMConsoleException(getErrorString(e));
} catch (AMConsoleException e) {
throw new AMConsoleException(getErrorString(e));
}
return (cxt != null) ? cxt : new IDFFAuthContexts();
}
use of com.sun.identity.console.federation.IDFFAuthContexts in project OpenAM by OpenRock.
the class IDFFModelImpl method getIDPAuthenticationContexts.
/**
* Returns the object of Auththentication Contexts in IDP.
*
* @param realm Realm of Entity
* @param entityName Name of Entity Descriptor.
* @return attributes values of provider.
*/
public IDFFAuthContexts getIDPAuthenticationContexts(String realm, String entityName) throws AMConsoleException {
String str = null;
IDFFAuthContexts cxt = new IDFFAuthContexts();
try {
List tmpList = new ArrayList();
IDFFMetaManager manager = getIDFFMetaManager();
Map map = new HashMap();
BaseConfigType idpConfig = manager.getIDPDescriptorConfig(realm, entityName);
if (idpConfig != null) {
map = IDFFMetaUtils.getAttributes(idpConfig);
} else {
throw new AMConsoleException("invalid.entity.name");
}
List list = (List) map.get(ATTR_IDP_AUTHN_CONTEXT_MAPPING);
for (int i = 0; i < list.size(); i++) {
String tmp = (String) list.get(i);
int index = tmp.lastIndexOf("|");
String level = removeKey(tmp.substring(index + 1));
tmp = tmp.substring(0, index);
index = tmp.lastIndexOf("|");
String value = removeKey(tmp.substring(index + 1));
tmp = tmp.substring(0, index);
index = tmp.indexOf("|");
String key = removeKey(tmp.substring(index + 1));
String name = removeKey(tmp.substring(0, index));
cxt.put(name, "true", key, value, level);
}
} catch (IDFFMetaException e) {
throw new AMConsoleException(getErrorString(e));
} catch (AMConsoleException e) {
throw new AMConsoleException(getErrorString(e));
}
return (cxt != null) ? cxt : new IDFFAuthContexts();
}
Aggregations