use of org.gluu.model.custom.script.conf.CustomScriptConfiguration in project oxAuth by GluuFederation.
the class U2fRegistrationWS method isCurrentAuthenticationLevelCorrespondsToU2fLevel.
private boolean isCurrentAuthenticationLevelCorrespondsToU2fLevel(String session) {
SessionId sessionId = sessionIdService.getSessionId(session);
if (sessionId == null)
return false;
String acrValuesStr = sessionIdService.getAcr(sessionId);
if (acrValuesStr == null)
return false;
CustomScriptConfiguration u2fScriptConfiguration = service.getCustomScriptConfigurationByName("u2f");
if (u2fScriptConfiguration == null)
return false;
String[] acrValuesArray = acrValuesStr.split(" ");
for (String acrValue : acrValuesArray) {
CustomScriptConfiguration currentScriptConfiguration = service.getCustomScriptConfigurationByName(acrValue);
if (currentScriptConfiguration == null)
continue;
if (currentScriptConfiguration.getLevel() >= u2fScriptConfiguration.getLevel())
return true;
}
return false;
}
use of org.gluu.model.custom.script.conf.CustomScriptConfiguration in project oxAuth by GluuFederation.
the class UmaGatherer method getScript.
protected CustomScriptConfiguration getScript(final SessionId session) {
String scriptName = umaSessionService.getScriptName(session);
CustomScriptConfiguration script = external.getCustomScriptConfigurationByName(scriptName);
return script;
}
use of org.gluu.model.custom.script.conf.CustomScriptConfiguration in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method buildScriptAliases.
private HashMap<String, String> buildScriptAliases() {
HashMap<String, String> newScriptAliases = new HashMap<String, String>();
for (Entry<String, CustomScriptConfiguration> script : customScriptConfigurationsNameMap.entrySet()) {
String name = script.getKey();
CustomScript customScript = script.getValue().getCustomScript();
newScriptAliases.put(name, name);
List<String> aliases = customScript.getAliases();
if (aliases != null) {
for (String alias : aliases) {
if (StringUtils.isNotBlank(alias)) {
newScriptAliases.put(alias, name);
}
}
}
}
return newScriptAliases;
}
use of org.gluu.model.custom.script.conf.CustomScriptConfiguration in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method getInternalCustomScriptConfiguration.
private CustomScriptConfiguration getInternalCustomScriptConfiguration(GluuLdapConfiguration ldapAuthConfig) {
CustomScriptConfiguration customScriptConfiguration = getInternalCustomScriptConfiguration();
customScriptConfiguration.getCustomScript().setName(ldapAuthConfig.getConfigId());
return customScriptConfiguration;
}
use of org.gluu.model.custom.script.conf.CustomScriptConfiguration in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method determineDefaultCustomScriptConfigurationsMap.
private Map<AuthenticationScriptUsageType, CustomScriptConfiguration> determineDefaultCustomScriptConfigurationsMap(Map<String, CustomScriptConfiguration> customScriptConfigurationsMap) {
Map<AuthenticationScriptUsageType, CustomScriptConfiguration> newDefaultCustomScriptConfigurationsMap = new HashMap<AuthenticationScriptUsageType, CustomScriptConfiguration>();
for (AuthenticationScriptUsageType usageType : AuthenticationScriptUsageType.values()) {
CustomScriptConfiguration defaultExternalAuthenticator = null;
for (CustomScriptConfiguration customScriptConfiguration : customScriptConfigurationsMapByUsageType.get(usageType)) {
// Determine default authenticator. It has bigger level than others
if ((defaultExternalAuthenticator == null) || (defaultExternalAuthenticator.getLevel() < customScriptConfiguration.getLevel())) {
defaultExternalAuthenticator = customScriptConfiguration;
}
}
newDefaultCustomScriptConfigurationsMap.put(usageType, defaultExternalAuthenticator);
}
return newDefaultCustomScriptConfigurationsMap;
}
Aggregations