Search in sources :

Example 1 with SimpleCustomProperty

use of io.jans.model.SimpleCustomProperty in project jans by JanssenProject.

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);
        saveScriptError(customScriptConfiguration.getCustomScript(), ex);
    }
    return null;
}
Also used : IdGeneratorType(io.jans.model.custom.script.type.id.IdGeneratorType) SimpleCustomProperty(io.jans.model.SimpleCustomProperty)

Example 2 with SimpleCustomProperty

use of io.jans.model.SimpleCustomProperty in project jans by JanssenProject.

the class ExternalAuthenticationService method executeExternalGetCountAuthenticationSteps.

public int executeExternalGetCountAuthenticationSteps(CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.trace("Executing python 'getCountAuthenticationSteps' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.getCountAuthenticationSteps(configurationAttributes);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        saveScriptError(customScriptConfiguration.getCustomScript(), ex);
    }
    return -1;
}
Also used : InternalDefaultPersonAuthenticationType(io.jans.as.server.service.external.internal.InternalDefaultPersonAuthenticationType) PersonAuthenticationType(io.jans.model.custom.script.type.auth.PersonAuthenticationType) SimpleCustomProperty(io.jans.model.SimpleCustomProperty)

Example 3 with SimpleCustomProperty

use of io.jans.model.SimpleCustomProperty in project jans by JanssenProject.

the class ExternalAuthenticationService method getLogoutExternalUrl.

public String getLogoutExternalUrl(CustomScriptConfiguration customScriptConfiguration, Map<String, String[]> requestParameters) {
    try {
        log.trace("Executing python 'getLogouExternalUrl' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.getLogoutExternalUrl(configurationAttributes, requestParameters);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        saveScriptError(customScriptConfiguration.getCustomScript(), ex);
    }
    return null;
}
Also used : InternalDefaultPersonAuthenticationType(io.jans.as.server.service.external.internal.InternalDefaultPersonAuthenticationType) PersonAuthenticationType(io.jans.model.custom.script.type.auth.PersonAuthenticationType) SimpleCustomProperty(io.jans.model.SimpleCustomProperty)

Example 4 with SimpleCustomProperty

use of io.jans.model.SimpleCustomProperty in project jans by JanssenProject.

the class ExternalAuthenticationService method executeExternalIsValidAuthenticationMethod.

private boolean executeExternalIsValidAuthenticationMethod(AuthenticationScriptUsageType usageType, CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.debug("Executing python 'isValidAuthenticationMethod' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.isValidAuthenticationMethod(usageType, configurationAttributes);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        saveScriptError(customScriptConfiguration.getCustomScript(), ex);
    }
    return false;
}
Also used : InternalDefaultPersonAuthenticationType(io.jans.as.server.service.external.internal.InternalDefaultPersonAuthenticationType) PersonAuthenticationType(io.jans.model.custom.script.type.auth.PersonAuthenticationType) SimpleCustomProperty(io.jans.model.SimpleCustomProperty)

Example 5 with SimpleCustomProperty

use of io.jans.model.SimpleCustomProperty in project jans by JanssenProject.

the class ExternalAuthenticationService method executeExternalGetExtraParametersForStep.

public List<String> executeExternalGetExtraParametersForStep(CustomScriptConfiguration customScriptConfiguration, int step) {
    try {
        log.trace("Executing python 'getExtraParametersForStep' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.getExtraParametersForStep(configurationAttributes, step);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        saveScriptError(customScriptConfiguration.getCustomScript(), ex);
    }
    return null;
}
Also used : InternalDefaultPersonAuthenticationType(io.jans.as.server.service.external.internal.InternalDefaultPersonAuthenticationType) PersonAuthenticationType(io.jans.model.custom.script.type.auth.PersonAuthenticationType) SimpleCustomProperty(io.jans.model.SimpleCustomProperty)

Aggregations

SimpleCustomProperty (io.jans.model.SimpleCustomProperty)46 ScimType (io.jans.model.custom.script.type.scim.ScimType)18 InternalDefaultPersonAuthenticationType (io.jans.as.server.service.external.internal.InternalDefaultPersonAuthenticationType)10 PersonAuthenticationType (io.jans.model.custom.script.type.auth.PersonAuthenticationType)10 CustomScriptConfiguration (io.jans.model.custom.script.conf.CustomScriptConfiguration)3 AuthenticationScriptUsageType (io.jans.model.AuthenticationScriptUsageType)2 BaseExternalType (io.jans.model.custom.script.type.BaseExternalType)2 IdGeneratorType (io.jans.model.custom.script.type.id.IdGeneratorType)2 IdpType (io.jans.model.custom.script.type.idp.IdpType)2 PersistenceType (io.jans.model.custom.script.type.persistence.PersistenceType)2 DynamicScopeType (io.jans.model.custom.script.type.scope.DynamicScopeType)2 ApplicationSessionType (io.jans.model.custom.script.type.session.ApplicationSessionType)2 Response (jakarta.ws.rs.core.Response)2 CustomProperty (io.jans.as.persistence.model.configuration.CustomProperty)1 SimpleExtendedCustomProperty (io.jans.model.SimpleExtendedCustomProperty)1 CustomAuthenticationConfiguration (io.jans.model.config.CustomAuthenticationConfiguration)1 CustomScript (io.jans.model.custom.script.model.CustomScript)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1