use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalApplicationSessionService method executeExternalEndSessionMethod.
public boolean executeExternalEndSessionMethod(CustomScriptConfiguration customScriptConfiguration, HttpServletRequest httpRequest, SessionState sessionState) {
try {
log.debug("Executing python 'endSession' method");
ApplicationSessionType applicationSessionType = (ApplicationSessionType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return applicationSessionType.endSession(httpRequest, sessionState, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return false;
}
use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method executeExternalUpdateClientMethod.
public boolean executeExternalUpdateClientMethod(CustomScriptConfiguration customScriptConfiguration, RegisterRequest registerRequest, Client client) {
try {
log.debug("Executing python 'updateClient' method");
ClientRegistrationType externalClientRegistrationType = (ClientRegistrationType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalClientRegistrationType.updateClient(registerRequest, client, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return false;
}
use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalDynamicScopeService method executeExternalUpdateMethod.
public boolean executeExternalUpdateMethod(CustomScriptConfiguration customScriptConfiguration, DynamicScopeExternalContext dynamicScopeContext) {
try {
log.debug("Executing python 'update' method");
DynamicScopeType dynamicScopeType = (DynamicScopeType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return dynamicScopeType.update(dynamicScopeContext, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return false;
}
use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalIdGeneratorService method executeExternalGenerateIdMethod.
public String executeExternalGenerateIdMethod(CustomScriptConfiguration customScriptConfiguration, String appId, String idType, String idPrefix) {
try {
log.debug("Executing python 'generateId' method");
IdGeneratorType externalType = (IdGeneratorType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalType.generateId(appId, idType, idPrefix, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return null;
}
use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class LdapCustomAuthenticationConfigurationService method mapCustomAuthentication.
private CustomAuthenticationConfiguration mapCustomAuthentication(oxIDPAuthConf oneConf) {
CustomAuthenticationConfiguration customAuthenticationConfig = new CustomAuthenticationConfiguration();
customAuthenticationConfig.setName(oneConf.getName());
customAuthenticationConfig.setLevel(oneConf.getLevel());
customAuthenticationConfig.setPriority(oneConf.getPriority());
customAuthenticationConfig.setEnabled(oneConf.getEnabled());
customAuthenticationConfig.setVersion(oneConf.getVersion());
for (CustomProperty customProperty : oneConf.getFields()) {
if ((customProperty.getValues() == null) || (customProperty.getValues().size() == 0)) {
continue;
}
String attrName = StringHelper.toLowerCase(customProperty.getName());
if (StringHelper.isEmpty(attrName)) {
continue;
}
String value = customProperty.getValues().get(0);
if (attrName.startsWith(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX)) {
String key = customProperty.getName().substring(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX.length());
SimpleCustomProperty property = new SimpleCustomProperty(key, value);
customAuthenticationConfig.getCustomAuthenticationAttributes().add(property);
} else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME)) {
customAuthenticationConfig.setCustomAuthenticationScript(value);
} else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE)) {
if (StringHelper.isNotEmpty(value)) {
AuthenticationScriptUsageType authenticationScriptUsageType = AuthenticationScriptUsageType.getByValue(value);
customAuthenticationConfig.setUsageType(authenticationScriptUsageType);
}
}
}
return customAuthenticationConfig;
}
Aggregations