Search in sources :

Example 1 with DynamicScopeType

use of org.gluu.model.custom.script.type.scope.DynamicScopeType 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;
}
Also used : DynamicScopeType(org.gluu.model.custom.script.type.scope.DynamicScopeType) SimpleCustomProperty(org.gluu.model.SimpleCustomProperty)

Example 2 with DynamicScopeType

use of org.gluu.model.custom.script.type.scope.DynamicScopeType 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;
}
Also used : DynamicScopeType(org.gluu.model.custom.script.type.scope.DynamicScopeType) SimpleCustomProperty(org.gluu.model.SimpleCustomProperty)

Aggregations

SimpleCustomProperty (org.gluu.model.SimpleCustomProperty)2 DynamicScopeType (org.gluu.model.custom.script.type.scope.DynamicScopeType)2