use of org.gluu.model.custom.script.type.BaseExternalType in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method getAuthModesByAcrValues.
public List<String> getAuthModesByAcrValues(List<String> acrValues) {
List<String> authModes = new ArrayList<String>();
for (String acrValue : acrValues) {
if (StringHelper.isNotEmpty(acrValue)) {
String customScriptName = StringHelper.toLowerCase(scriptName(acrValue));
if (customScriptConfigurationsNameMap.containsKey(customScriptName)) {
CustomScriptConfiguration customScriptConfiguration = customScriptConfigurationsNameMap.get(customScriptName);
CustomScript customScript = customScriptConfiguration.getCustomScript();
// Handle internal authentication method
if (customScript.isInternal()) {
authModes.add(scriptName(acrValue));
continue;
}
CustomScriptType customScriptType = customScriptConfiguration.getCustomScript().getScriptType();
BaseExternalType defaultImplementation = customScriptType.getDefaultImplementation();
BaseExternalType pythonImplementation = customScriptConfiguration.getExternalType();
if ((pythonImplementation != null) && (defaultImplementation != pythonImplementation)) {
authModes.add(scriptName(acrValue));
}
}
}
}
return authModes;
}
Aggregations