Search in sources :

Example 31 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.

the class ExternalAuthenticationService method executeExternalAuthenticate.

public boolean executeExternalAuthenticate(CustomScriptConfiguration customScriptConfiguration, Map<String, String[]> requestParameters, int step) {
    try {
        log.debug("Executing python 'authenticate' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.authenticate(configurationAttributes, requestParameters, step);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
    return false;
}
Also used : PersonAuthenticationType(org.xdi.model.custom.script.type.auth.PersonAuthenticationType) InternalDefaultPersonAuthenticationType(org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 32 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.

the class ExternalAuthenticationService method executeExternalGetAlternativeAuthenticationMethod.

private String executeExternalGetAlternativeAuthenticationMethod(AuthenticationScriptUsageType usageType, CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.debug("Executing python 'getAlternativeAuthenticationMethod' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.getAlternativeAuthenticationMethod(usageType, configurationAttributes);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
    return null;
}
Also used : PersonAuthenticationType(org.xdi.model.custom.script.type.auth.PersonAuthenticationType) InternalDefaultPersonAuthenticationType(org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 33 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.

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);
    }
    return false;
}
Also used : PersonAuthenticationType(org.xdi.model.custom.script.type.auth.PersonAuthenticationType) InternalDefaultPersonAuthenticationType(org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 34 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.

the class ExternalAuthenticationService method executeExternalPrepareForStep.

public boolean executeExternalPrepareForStep(CustomScriptConfiguration customScriptConfiguration, Map<String, String[]> requestParameters, int step) {
    try {
        log.debug("Executing python 'prepareForStep' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.prepareForStep(configurationAttributes, requestParameters, step);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
    return false;
}
Also used : PersonAuthenticationType(org.xdi.model.custom.script.type.auth.PersonAuthenticationType) InternalDefaultPersonAuthenticationType(org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 35 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxAuth by GluuFederation.

the class ExternalAuthenticationService method getNextStep.

public int getNextStep(CustomScriptConfiguration customScriptConfiguration, Map<String, String[]> requestParameters, int step) {
    try {
        log.debug("Executing python 'getNextStep' authenticator method");
        PersonAuthenticationType externalAuthenticator = (PersonAuthenticationType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalAuthenticator.getNextStep(configurationAttributes, requestParameters, step);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
    return -1;
}
Also used : PersonAuthenticationType(org.xdi.model.custom.script.type.auth.PersonAuthenticationType) InternalDefaultPersonAuthenticationType(org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Aggregations

SimpleCustomProperty (org.xdi.model.SimpleCustomProperty)41 PersonAuthenticationType (org.xdi.model.custom.script.type.auth.PersonAuthenticationType)10 InternalDefaultPersonAuthenticationType (org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType)10 ScimType (org.xdi.model.custom.script.type.scim.ScimType)6 CustomScript (org.xdi.model.custom.script.model.CustomScript)4 UpdateUserType (org.xdi.model.custom.script.type.user.UpdateUserType)4 UserRegistrationType (org.xdi.model.custom.script.type.user.UserRegistrationType)4 AuthenticationCustomScript (org.xdi.model.custom.script.model.auth.AuthenticationCustomScript)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AuthenticationScriptUsageType (org.xdi.model.AuthenticationScriptUsageType)2 CustomScriptConfiguration (org.xdi.model.custom.script.conf.CustomScriptConfiguration)2 BaseExternalType (org.xdi.model.custom.script.type.BaseExternalType)2 IdGeneratorType (org.xdi.model.custom.script.type.id.IdGeneratorType)2 File (java.io.File)1 FileFilter (java.io.FileFilter)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 List (java.util.List)1 Entry (java.util.Map.Entry)1