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;
}
Aggregations