use of org.gluu.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method getInternalCustomScriptConfiguration.
private CustomScriptConfiguration getInternalCustomScriptConfiguration() {
CustomScript customScript = new AuthenticationCustomScript() {
@Override
public AuthenticationScriptUsageType getUsageType() {
return AuthenticationScriptUsageType.INTERACTIVE;
}
};
customScript.setName(OxConstants.SCRIPT_TYPE_INTERNAL_RESERVED_NAME);
customScript.setLevel(-1);
customScript.setInternal(true);
CustomScriptConfiguration customScriptConfiguration = new CustomScriptConfiguration(customScript, internalDefaultPersonAuthenticationType, new HashMap<String, SimpleCustomProperty>(0));
return customScriptConfiguration;
}
use of org.gluu.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalDynamicScopeService method executeExternalUpdateMethod.
public boolean executeExternalUpdateMethod(CustomScriptConfiguration customScriptConfiguration, DynamicScopeExternalContext dynamicScopeContext) {
try {
log.trace("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);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
return false;
}
use of org.gluu.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalDynamicScopeService method executeExternalGetSupportedClaimsMethod.
public List<String> executeExternalGetSupportedClaimsMethod(CustomScriptConfiguration customScriptConfiguration) {
int apiVersion = executeExternalGetApiVersion(customScriptConfiguration);
if (apiVersion > 1) {
try {
log.trace("Executing python 'get supported claims' method");
DynamicScopeType dynamicScopeType = (DynamicScopeType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return dynamicScopeType.getSupportedClaims(configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
}
return null;
}
use of org.gluu.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.trace("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);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
return null;
}
use of org.gluu.model.SimpleCustomProperty in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method executeExternalCreateClientMethod.
public boolean executeExternalCreateClientMethod(CustomScriptConfiguration customScriptConfiguration, RegisterRequest registerRequest, Client client) {
try {
log.trace("Executing python 'createClient' method");
ClientRegistrationType externalClientRegistrationType = (ClientRegistrationType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalClientRegistrationType.createClient(registerRequest, client, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
return false;
}
Aggregations