diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/ApplicationAuthenticatorService.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/ApplicationAuthenticatorService.java
index e93a82f42b75..83beb315cdf2 100644
--- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/ApplicationAuthenticatorService.java
+++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/ApplicationAuthenticatorService.java
@@ -18,6 +18,8 @@
package org.wso2.carbon.identity.application.common;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig;
import org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig;
import org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig;
@@ -31,6 +33,7 @@
public class ApplicationAuthenticatorService {
private static volatile ApplicationAuthenticatorService instance;
+ private static final Log LOG = LogFactory.getLog(ApplicationAuthenticatorService.class);
private List localAuthenticators = new ArrayList<>();
private List federatedAuthenticators = new ArrayList<>();
@@ -88,6 +91,9 @@ public RequestPathAuthenticatorConfig getRequestPathAuthenticatorByName(String n
public void addLocalAuthenticator(LocalAuthenticatorConfig authenticator) {
if (authenticator != null) {
+ if (authenticator.getDefinedByType() == null) {
+ LOG.warn("The defined by type is not set for the : " + authenticator.getName());
+ }
localAuthenticators.add(authenticator);
}
}
@@ -100,6 +106,9 @@ public void removeLocalAuthenticator(LocalAuthenticatorConfig authenticator) {
public void addFederatedAuthenticator(FederatedAuthenticatorConfig authenticator) {
if (authenticator != null) {
+ if (authenticator.getDefinedByType() == null) {
+ LOG.warn("The defined by type is not set for the : " + authenticator.getName());
+ }
federatedAuthenticators.add(authenticator);
}
}
diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/FederatedAuthenticatorConfig.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/FederatedAuthenticatorConfig.java
index 40ad2fb904b5..88dc1888959c 100644
--- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/FederatedAuthenticatorConfig.java
+++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/FederatedAuthenticatorConfig.java
@@ -22,6 +22,9 @@
import org.apache.axiom.om.OMElement;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.wso2.carbon.identity.base.IdentityConstants;
import java.io.Serializable;
import java.util.ArrayList;
@@ -46,6 +49,7 @@
public class FederatedAuthenticatorConfig implements Serializable {
private static final long serialVersionUID = -2361107623257323257L;
+ private static final Logger LOG = LoggerFactory.getLogger(LocalAuthenticatorConfig.class);
@XmlElement(name = "Name")
protected String name;
@@ -63,6 +67,8 @@ public class FederatedAuthenticatorConfig implements Serializable {
@XmlElement(name = "Tags")
protected String[] tags;
+ protected IdentityConstants.DefinedByType definedByType;
+
public static FederatedAuthenticatorConfig build(OMElement federatedAuthenticatorConfigOM) {
if (federatedAuthenticatorConfigOM == null) {
@@ -101,9 +107,15 @@ public static FederatedAuthenticatorConfig build(OMElement federatedAuthenticato
Property[] propertiesArr = propertiesArrList.toArray(new Property[propertiesArrList.size()]);
federatedAuthenticatorConfig.setProperties(propertiesArr);
}
+ } else if ("DefinedBy".equals(elementName)) {
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
}
}
+ if (federatedAuthenticatorConfig.getDefinedByType() == null) {
+ LOG.warn("The defined by type is not set for the : " + federatedAuthenticatorConfig.getName());
+ }
+
return federatedAuthenticatorConfig;
}
@@ -230,4 +242,24 @@ public void setTags(String[] tagList) {
tags = tagList;
}
+
+ /**
+ * Get the tag list of the Local authenticator.
+ *
+ * @return String[]
+ */
+ public IdentityConstants.DefinedByType getDefinedByType() {
+
+ return definedByType;
+ }
+
+ /**
+ * Set the tag list for Local authenticator config.
+ *
+ * @param type authenticator.
+ */
+ public void setDefinedByType(IdentityConstants.DefinedByType type) {
+
+ definedByType = type;
+ }
}
diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/IdentityProvider.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/IdentityProvider.java
index 5c55a44624ba..dfea25fa6d28 100644
--- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/IdentityProvider.java
+++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/IdentityProvider.java
@@ -58,6 +58,7 @@
public class IdentityProvider implements Serializable {
private static final long serialVersionUID = 2199048941051702943L;
+ private static final Log LOG = LogFactory.getLog(IdentityProvider.class);
private static final Log log = LogFactory.getLog(IdentityProvider.class);
private static final String FILE_ELEMENT_IDENTITY_PROVIDER_NAME = "IdentityProviderName";
@@ -419,6 +420,11 @@ public void setFederatedAuthenticatorConfigs(
if (federatedAuthenticatorConfigs == null) {
return;
}
+ for (FederatedAuthenticatorConfig config: federatedAuthenticatorConfigs) {
+ if (config.getDefinedByType() == null) {
+ LOG.warn("The defined by type is not set for the : " + config.getName());
+ }
+ }
Set propertySet =
new HashSet(Arrays.asList(federatedAuthenticatorConfigs));
this.federatedAuthenticatorConfigs = propertySet.toArray(new FederatedAuthenticatorConfig[propertySet.size()]);
diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/LocalAuthenticatorConfig.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/LocalAuthenticatorConfig.java
index cfe369a544e3..1b84d6ec7053 100644
--- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/LocalAuthenticatorConfig.java
+++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/LocalAuthenticatorConfig.java
@@ -22,6 +22,8 @@
import org.apache.axiom.om.OMElement;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.wso2.carbon.identity.base.IdentityConstants;
import java.io.Serializable;
@@ -46,6 +48,7 @@
public class LocalAuthenticatorConfig implements Serializable {
private static final long serialVersionUID = 3363298518257599291L;
+ private static final Logger LOG = LoggerFactory.getLogger(LocalAuthenticatorConfig.class);
@XmlElement(name = "Name")
protected String name;
@@ -63,6 +66,8 @@ public class LocalAuthenticatorConfig implements Serializable {
@XmlElement(name = "Tags")
protected String[] tags;
+ protected IdentityConstants.DefinedByType definedByType;
+
/*
*
*
@@ -111,6 +116,11 @@ public static LocalAuthenticatorConfig build(OMElement localAuthenticatorConfigO
Property[] propertiesArr = propertiesArrList.toArray(new Property[0]);
localAuthenticatorConfig.setProperties(propertiesArr);
}
+ } else if ("DefinedBy".equals(member.getLocalName())) {
+ localAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.valueOf(member.getText()));
+ }
+ if (localAuthenticatorConfig.getDefinedByType() == null) {
+ LOG.warn("The defined by type is not set for the : " + localAuthenticatorConfig.getName());
}
}
return localAuthenticatorConfig;
@@ -224,4 +234,24 @@ public void setTags(String[] tagList) {
tags = tagList;
}
+
+ /**
+ * Get the tag list of the Local authenticator.
+ *
+ * @return String[]
+ */
+ public IdentityConstants.DefinedByType getDefinedByType() {
+
+ return definedByType;
+ }
+
+ /**
+ * Set the tag list for Local authenticator config.
+ *
+ * @param type authenticator.
+ */
+ public void setDefinedByType(IdentityConstants.DefinedByType type) {
+
+ definedByType = type;
+ }
}
diff --git a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java
index 745068863338..f4faef6505de 100644
--- a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java
+++ b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java
@@ -1566,6 +1566,15 @@ private void updateLocalAndOutboundAuthenticationConfiguration(int applicationId
ApplicationConstants.LOCAL_IDP_NAME,
lclAuthenticator.getName(),
lclAuthenticator.getDisplayName());
+ } else {
+ if (lclAuthenticator.getDefinedByType() == null) {
+ log.warn("Authenticator already exists. Updating the authenticator, but the " +
+ "defined by type is not set.");
+ } else {
+ log.debug("Authenticator already exists. Updating the authenticator.The defined "
+ + "by type is set to: " + lclAuthenticator.getDefinedByType().toString());
+ //TODO: Update database with defined by properties for local authenticators.
+ }
}
if (authenticatorId > 0) {
// ID, TENANT_ID, AUTHENTICATOR_ID
@@ -5038,7 +5047,7 @@ private int addAuthenticator(Connection conn, int tenantId, String idpName,
int authenticatorId = -1;
PreparedStatement prepStmt = null;
ResultSet rs = null;
- // TENANT_ID, IDP_ID, NAME,IS_ENABLED, DISPLAY_NAME
+ // TENANT_ID, IDP_ID, NAME,IS_ENABLED, DISPLAY_NAME, DEFINED_BY
String sqlStmt = ApplicationMgtDBQueries.STORE_LOCAL_AUTHENTICATOR;
try {
String dbProductName = conn.getMetaData().getDatabaseProductName();
@@ -5050,6 +5059,7 @@ private int addAuthenticator(Connection conn, int tenantId, String idpName,
prepStmt.setString(4, authenticatorName);
prepStmt.setString(5, "1");
prepStmt.setString(6, authenticatorDispalyName);
+ //TODO: prepStmt.setString(7, IdentityConstants.DefinedByType.SYSTEM.toString());
prepStmt.execute();
rs = prepStmt.getGeneratedKeys();
if (rs.next()) {
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/ApplicationAuthenticator.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/ApplicationAuthenticator.java
index 6c974a31d83b..c9756c44a120 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/ApplicationAuthenticator.java
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/ApplicationAuthenticator.java
@@ -24,6 +24,7 @@
import org.wso2.carbon.identity.application.authentication.framework.exception.LogoutFailedException;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatorData;
import org.wso2.carbon.identity.application.common.model.Property;
+import org.wso2.carbon.identity.base.IdentityConstants;
import java.io.Serializable;
import java.util.List;
@@ -171,4 +172,13 @@ default String getI18nKey() {
return StringUtils.EMPTY;
}
+ /**
+ * Get the authenticator type. Default value will be SYSTEM.
+ *
+ * @return Authenticator Type.
+ */
+ default IdentityConstants.DefinedByType getDefinedByType() {
+
+ return IdentityConstants.DefinedByType.SYSTEM;
+ }
}
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/internal/FrameworkServiceComponent.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/internal/FrameworkServiceComponent.java
index c781132f5f08..e07d52a59813 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/internal/FrameworkServiceComponent.java
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/internal/FrameworkServiceComponent.java
@@ -99,6 +99,7 @@
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig;
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
+import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService;
import org.wso2.carbon.identity.configuration.mgt.core.ConfigurationManager;
import org.wso2.carbon.identity.core.handler.HandlerComparator;
@@ -506,6 +507,7 @@ protected void setAuthenticator(ApplicationAuthenticator authenticator) {
localAuthenticatorConfig.setProperties(configProperties);
localAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
localAuthenticatorConfig.setTags(getTags(authenticator));
+ localAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
AuthenticatorConfig fileBasedConfig = getAuthenticatorConfig(authenticator.getName());
localAuthenticatorConfig.setEnabled(fileBasedConfig.isEnabled());
ApplicationAuthenticatorService.getInstance().addLocalAuthenticator(localAuthenticatorConfig);
@@ -515,6 +517,7 @@ protected void setAuthenticator(ApplicationAuthenticator authenticator) {
federatedAuthenticatorConfig.setProperties(configProperties);
federatedAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
federatedAuthenticatorConfig.setTags(getTags(authenticator));
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
ApplicationAuthenticatorService.getInstance().addFederatedAuthenticator(federatedAuthenticatorConfig);
} else if (authenticator instanceof RequestPathApplicationAuthenticator) {
RequestPathAuthenticatorConfig reqPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
@@ -524,6 +527,7 @@ protected void setAuthenticator(ApplicationAuthenticator authenticator) {
reqPathAuthenticatorConfig.setTags(getTags(authenticator));
AuthenticatorConfig fileBasedConfig = getAuthenticatorConfig(authenticator.getName());
reqPathAuthenticatorConfig.setEnabled(fileBasedConfig.isEnabled());
+ reqPathAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
ApplicationAuthenticatorService.getInstance().addRequestPathAuthenticator(reqPathAuthenticatorConfig);
}
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/builder/test-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/builder/test-sp-1.xml
index 44ec88d52dc8..c5d1833f5a52 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/builder/test-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/builder/test-sp-1.xml
@@ -37,6 +37,7 @@
BasicAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/js-sp-1.xml
index c35c0cd0916f..3cac5e5a2980 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/js-sp-1.xml
@@ -37,6 +37,7 @@
BasicAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/request/impl/default-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/request/impl/default-sp-1.xml
index f9bd84a5c572..730d65374a77 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/request/impl/default-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/request/impl/default-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/disabled-js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/disabled-js-sp-1.xml
index fd7cdb1eb9a4..bc13d623b51c 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/disabled-js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/disabled-js-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-function-js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-function-js-sp-1.xml
index 640fc3267fa0..ecc26a5febe9 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-function-js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-function-js-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-js-sp-1.xml
index 8d285e8c5d2a..569537e5bd63 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/incorrect-js-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-1.xml
index 22ec2a89a033..57140d8e628b 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-2.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-2.xml
index ad433285aca2..6038bdbb9a91 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-2.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-2.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-3.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-3.xml
index 58a638b5d4da..8c2a6bc47590 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-3.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-3.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-4-claim.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-4-claim.xml
index 9e2cda58d347..a14a2c7e2b70 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-4-claim.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-4-claim.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-5-claim.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-5-claim.xml
index c90b15dfa764..48084a527bfa 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-5-claim.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-5-claim.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-1.xml
index 60af8fbc979e..9b00ba6300b4 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fail.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fail.xml
index 95b372d95f1b..0300ba078158 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fail.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fail.xml
@@ -36,6 +36,7 @@
BasicMockAuthenticator
basicauth
+ SYSTEM
true
@@ -85,6 +86,7 @@
BasicFailingMockAuthenticator
basicauthfialing
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fallback.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fallback.xml
index f4245893aa92..9ea3bcb46786 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fallback.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-dynamic-on-fallback.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
@@ -85,6 +86,7 @@
MockFallbackAuthenticator
basicauthfallback
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-exception-retry.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-exception-retry.xml
index 1be3b3ca555a..7f4135274605 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-exception-retry.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-exception-retry.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onFail.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onFail.xml
index 01e655ce5802..3f845b1a6872 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onFail.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onFail.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onSuccess.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onSuccess.xml
index d711487f2b2c..0d5e7ba8f00b 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onSuccess.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-with-params-onSuccess.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onFail.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onFail.xml
index 50552737033d..8a1bf4439ce1 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onFail.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onFail.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onSuccsss.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onSuccsss.xml
index 7c9ccd48f3bc..8148497e6592 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onSuccsss.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-fail-method-without-params-onSuccsss.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-longwait-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-longwait-1.xml
index 3cbd00f0b97c..eecff7c2d5cd 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-longwait-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/js-sp-longwait-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/no-js-sp-1.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/no-js-sp-1.xml
index fb3b8cb657d1..3fb1fe134b44 100644
--- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/no-js-sp-1.xml
+++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/no-js-sp-1.xml
@@ -37,6 +37,7 @@
BasicMockAuthenticator
basicauth
true
+ SYSTEM
true
diff --git a/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/IdentityConstants.java b/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/IdentityConstants.java
index a5b96babf759..c2a3cbdbe557 100644
--- a/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/IdentityConstants.java
+++ b/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/IdentityConstants.java
@@ -619,4 +619,13 @@ public static class APIResponse {
public static final String SET_ACCOUNT_LOCK_AUTH_FAILURE_REASON = "APIResponse.SetAccountLockAuthFailureReason";
}
+
+ /**
+ * The Authentication Type - SYSTEM: system define authenticator, CUSTOM: user defined authentication extension.
+ */
+ public enum DefinedByType {
+
+ SYSTEM,
+ USER
+ }
}
diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java
index c383da9a34ff..a28c1db25115 100644
--- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java
+++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java
@@ -171,6 +171,7 @@ public void addResidentIdP(IdentityProvider identityProvider, String tenantDomai
if (saml2SSOResidentAuthenticatorConfig == null) {
saml2SSOResidentAuthenticatorConfig = new FederatedAuthenticatorConfig();
saml2SSOResidentAuthenticatorConfig.setName(IdentityApplicationConstants.Authenticator.SAML2SSO.NAME);
+ saml2SSOResidentAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
}
if (saml2SSOResidentAuthenticatorConfig.getProperties() == null) {
saml2SSOResidentAuthenticatorConfig.setProperties(new Property[0]);
@@ -255,6 +256,7 @@ public void addResidentIdP(IdentityProvider identityProvider, String tenantDomai
FederatedAuthenticatorConfig oidcAuthenticationConfig = new FederatedAuthenticatorConfig();
oidcAuthenticationConfig.setProperties(new Property[]{oidcProperty});
oidcAuthenticationConfig.setName(IdentityApplicationConstants.Authenticator.OIDC.NAME);
+ oidcAuthenticationConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property passiveStsProperty = new Property();
passiveStsProperty.setName(IdentityApplicationConstants.Authenticator.PassiveSTS.IDENTITY_PROVIDER_ENTITY_ID);
@@ -263,6 +265,7 @@ public void addResidentIdP(IdentityProvider identityProvider, String tenantDomai
FederatedAuthenticatorConfig passiveStsAuthenticationConfig = new FederatedAuthenticatorConfig();
passiveStsAuthenticationConfig.setProperties(new Property[]{passiveStsProperty});
passiveStsAuthenticationConfig.setName(IdentityApplicationConstants.Authenticator.PassiveSTS.NAME);
+ passiveStsAuthenticationConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
FederatedAuthenticatorConfig[] federatedAuthenticatorConfigs = {saml2SSOResidentAuthenticatorConfig,
passiveStsAuthenticationConfig, oidcAuthenticationConfig};
diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java
index 3c382c249765..c5b166a31c15 100644
--- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java
+++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java
@@ -1148,6 +1148,7 @@ private FederatedAuthenticatorConfig[] getFederatedAuthenticatorConfigs(
}
authnConfig.setDisplayName(rs.getString("DISPLAY_NAME"));
+ authnConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
if (defaultAuthName != null && authnConfig.getName().equals(defaultAuthName)) {
federatedIdp.getDefaultAuthenticatorConfig().setDisplayName(authnConfig.getDisplayName());
@@ -1424,6 +1425,7 @@ public void addFederatedAuthenticatorConfig(FederatedAuthenticatorConfig authnCo
}
prepStmt1.setString(4, authnConfig.getName());
prepStmt1.setString(5, authnConfig.getDisplayName());
+ //TODO: prepStmt1.setString(6, authnConfig.getDefinedByType().toString());
prepStmt1.execute();
int authnId = getAuthenticatorIdentifier(dbConnection, idpId, authnConfig.getName());
diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/IdentityProviderManagementServiceTest.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/IdentityProviderManagementServiceTest.java
index a9c3a7926b21..d54c396949f9 100644
--- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/IdentityProviderManagementServiceTest.java
+++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/IdentityProviderManagementServiceTest.java
@@ -37,6 +37,7 @@
import org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig;
import org.wso2.carbon.identity.application.common.model.RoleMapping;
import org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants;
+import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl;
import org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException;
import org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim;
@@ -132,6 +133,7 @@ public Object[][] addIdPData() {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -557,6 +559,7 @@ public Object[][] updateIdPData() {
newFederatedAuthenticatorConfig.setDisplayName("DisplayName1New");
newFederatedAuthenticatorConfig.setName("Name");
newFederatedAuthenticatorConfig.setEnabled(true);
+ newFederatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property newProperty1 = new Property();
newProperty1.setName("Property1New");
newProperty1.setValue("value1New");
@@ -796,6 +799,7 @@ public Object[][] updateResidentIdPData() {
facNew.setDisplayName("DisplayName1New");
facNew.setName("Name");
facNew.setEnabled(true);
+ facNew.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
idp2New.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[]{facNew});
// Initialize New Resident Identity Provider 3.
@@ -893,6 +897,7 @@ public void testGetResidentIDPMetadata() throws Exception {
facNew.setDisplayName("SAML2SSO");
facNew.setName("saml2sso");
facNew.setEnabled(true);
+ facNew.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
newIdp.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[]{facNew});
identityProviderManagementService.updateResidentIdP((IdentityProvider) newIdp);
@@ -915,6 +920,7 @@ public void testGetResidentIDPMetadataException() throws Exception {
facNew.setDisplayName("SAML2SSO");
facNew.setName("saml2sso");
facNew.setEnabled(true);
+ facNew.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
newIdp.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[]{facNew});
identityProviderManagementService.updateResidentIdP((IdentityProvider) newIdp);
@@ -950,6 +956,7 @@ private void addTestIdps() throws IdentityProviderManagementException {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -1103,6 +1110,7 @@ private IdentityProvider addIdPDataWithSameIdpEntityId(String idpName) {
federatedAuthenticatorConfig.setDisplayName("DisplayName");
federatedAuthenticatorConfig.setName("SAMLSSOAuthenticator");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("SPEntityId");
property1.setValue("wso2-is");
diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/CacheBackedIdPMgtDAOTest.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/CacheBackedIdPMgtDAOTest.java
index 853052a55842..1d00094a3b1a 100644
--- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/CacheBackedIdPMgtDAOTest.java
+++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/CacheBackedIdPMgtDAOTest.java
@@ -39,6 +39,7 @@
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig;
import org.wso2.carbon.identity.application.common.model.RoleMapping;
+import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.core.model.ExpressionNode;
import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
@@ -742,6 +743,7 @@ public Object[][] addIdPData() {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -845,6 +847,7 @@ public Object[][] updateIdPData() {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -902,6 +905,7 @@ public Object[][] updateIdPData() {
newFederatedAuthenticatorConfig.setDisplayName("DisplayName1New");
newFederatedAuthenticatorConfig.setName("Name");
newFederatedAuthenticatorConfig.setEnabled(true);
+ newFederatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1New = new Property();
property1New.setName("Property1New");
property1New.setValue("value1New");
@@ -1449,6 +1453,7 @@ private void addTestIdps() throws IdentityProviderManagementException {
FederatedAuthenticatorConfig federatedAuthenticatorConfig = new FederatedAuthenticatorConfig();
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
federatedAuthenticatorConfig.setEnabled(true);
Property property1 = new Property();
property1.setName("Property1");
diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAOTest.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAOTest.java
index e7b93e916790..f196b9a35447 100644
--- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAOTest.java
+++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/test/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAOTest.java
@@ -40,6 +40,7 @@
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig;
import org.wso2.carbon.identity.application.common.model.RoleMapping;
+import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.core.model.ExpressionNode;
import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
@@ -588,6 +589,7 @@ public Object[][] addIdPData() {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -1104,6 +1106,7 @@ public Object[][] updateIdPData() {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -1161,6 +1164,7 @@ public Object[][] updateIdPData() {
newFederatedAuthenticatorConfig.setDisplayName("DisplayName1New");
newFederatedAuthenticatorConfig.setName("Name");
newFederatedAuthenticatorConfig.setEnabled(true);
+ newFederatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1New = new Property();
property1New.setName("Property1New");
property1New.setValue("value1New");
@@ -1733,6 +1737,7 @@ private void addTestIdps() throws IdentityProviderManagementException {
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
@@ -1864,6 +1869,7 @@ private void addTestTrustedTokenIssuers() throws IdentityProviderManagementExcep
federatedAuthenticatorConfig.setDisplayName("DisplayName1");
federatedAuthenticatorConfig.setName("Name");
federatedAuthenticatorConfig.setEnabled(true);
+ federatedAuthenticatorConfig.setDefinedByType(IdentityConstants.DefinedByType.SYSTEM);
Property property1 = new Property();
property1.setName("Property1");
property1.setValue("value1");
diff --git a/features/application-mgt/org.wso2.carbon.identity.application.mgt.server.feature/resources/identity/service-providers/default.xml b/features/application-mgt/org.wso2.carbon.identity.application.mgt.server.feature/resources/identity/service-providers/default.xml
index acab17557805..ba8682638a72 100644
--- a/features/application-mgt/org.wso2.carbon.identity.application.mgt.server.feature/resources/identity/service-providers/default.xml
+++ b/features/application-mgt/org.wso2.carbon.identity.application.mgt.server.feature/resources/identity/service-providers/default.xml
@@ -35,6 +35,7 @@
BasicAuthenticator
basicauth
true
+ SYSTEM