Search in sources :

Example 31 with LocalAuthenticatorConfig

use of org.wso2.carbon.identity.application.common.model.xsd.LocalAuthenticatorConfig in project identity-api-server by wso2.

the class ServerConfigManagementService method buildAuthenticatorResponse.

private Authenticator buildAuthenticatorResponse(LocalAuthenticatorConfig config) {
    Authenticator authenticator = new Authenticator();
    authenticator.setId(base64URLEncode(config.getName()));
    authenticator.setName(config.getName());
    authenticator.setDisplayName(config.getDisplayName());
    authenticator.setIsEnabled(config.isEnabled());
    if (config instanceof RequestPathAuthenticatorConfig) {
        authenticator.setType(Authenticator.TypeEnum.REQUEST_PATH);
    } else {
        authenticator.setType(Authenticator.TypeEnum.LOCAL);
    }
    String[] tags = config.getTags();
    if (ArrayUtils.isNotEmpty(tags)) {
        authenticator.setTags(Arrays.asList(tags));
    }
    List<AuthenticatorProperty> authenticatorProperties = Arrays.stream(config.getProperties()).map(propertyToExternal).collect(Collectors.toList());
    authenticator.setProperties(authenticatorProperties);
    return authenticator;
}
Also used : AuthenticatorProperty(org.wso2.carbon.identity.api.server.configs.v1.model.AuthenticatorProperty) RequestPathAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig) Authenticator(org.wso2.carbon.identity.api.server.configs.v1.model.Authenticator)

Aggregations

LocalAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig)19 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)11 FederatedAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig)9 RequestPathAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig)8 AuthenticationStep (org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)8 LocalAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAuthenticatorConfig)8 ArrayList (java.util.ArrayList)7 AuthenticationStep (org.wso2.carbon.identity.application.common.model.AuthenticationStep)7 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig)6 HashMap (java.util.HashMap)4 AuthenticatorConfig (org.wso2.carbon.identity.application.authentication.framework.config.model.AuthenticatorConfig)4 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)4 Map (java.util.Map)3 Authenticator (org.wso2.carbon.identity.api.server.authenticators.v1.model.Authenticator)3 StepConfig (org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig)3 Property (org.wso2.carbon.identity.application.common.model.Property)3 IOException (java.io.IOException)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 List (java.util.List)2