diff --git a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationConstants.java b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationConstants.java index 2bca40c45d54..786ce81d1ef9 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationConstants.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationConstants.java @@ -50,6 +50,7 @@ private ApplicationConstants() { public static final String IDP_NAME = "idpName"; public static final String IDP_AUTHENTICATOR_NAME = "authenticatorName"; public static final String IDP_AUTHENTICATOR_DISPLAY_NAME = "authenticatorDisplayName"; + public static final String IDP_AUTHENTICATOR_DEFINED_BY_TYPE = "definedByType"; public static final String APPLICATION_DOMAIN = "Application"; // Regex for validating application name. public static final String APP_NAME_VALIDATING_REGEX = "^[a-zA-Z0-9 ._-]*$"; diff --git a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationMgtDBQueries.java b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationMgtDBQueries.java index 70ffca50df7d..665a1423daef 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationMgtDBQueries.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationMgtDBQueries.java @@ -289,7 +289,8 @@ public class ApplicationMgtDBQueries { "B.DISPLAY_NAME FROM IDP A JOIN IDP_AUTHENTICATOR B ON A.ID = B.IDP_ID WHERE B.ID =? AND ((A.TENANT_ID =?" + " AND B.TENANT_ID =?) OR (A.TENANT_ID=? AND A.NAME LIKE 'SHARED_%' AND B.TENANT_ID=?))"; public static final String STORE_LOCAL_AUTHENTICATOR = "INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME," + - "IS_ENABLED, DISPLAY_NAME) VALUES (?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?)"; + "IS_ENABLED, DISPLAY_NAME, DEFINED_BY) " + + "VALUES (?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?, ?)"; public static final String GET_SP_METADATA_BY_SP_ID = "SELECT ID, NAME, VALUE, DISPLAY_NAME FROM SP_METADATA " + "WHERE SP_ID = ?"; 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..3878291aed41 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 @@ -77,6 +77,7 @@ import org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO; import org.wso2.carbon.identity.application.mgt.internal.ApplicationManagementServiceComponent; import org.wso2.carbon.identity.application.mgt.internal.ApplicationManagementServiceComponentHolder; +import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.base.IdentityRuntimeException; import org.wso2.carbon.identity.core.CertificateRetrievingException; @@ -1565,7 +1566,16 @@ private void updateLocalAndOutboundAuthenticationConfiguration(int applicationId authenticatorId = addAuthenticator(connection, tenantID, ApplicationConstants.LOCAL_IDP_NAME, lclAuthenticator.getName(), - lclAuthenticator.getDisplayName()); + lclAuthenticator.getDisplayName(), + lclAuthenticator.getDefinedByType().toString()); + } else { + /* On demand migration for already saved local authenticators to save definedBy and + authenticationType properties to the database. + Remove this else block, once on-demand migration is done.*/ + log.debug("Authenticator already exists. Updating the authenticator.The defined " + + "by type is setting to: " + lclAuthenticator.getDefinedByType().toString()); + onDemandMigrationForDefinedByType(connection, tenantID, authenticatorId, + lclAuthenticator.getDefinedByType().toString()); } if (authenticatorId > 0) { // ID, TENANT_ID, AUTHENTICATOR_ID @@ -3088,6 +3098,8 @@ private LocalAndOutboundAuthenticationConfig getLocalAndOutboundAuthenticationCo .get(ApplicationConstants.IDP_AUTHENTICATOR_NAME)); localAuthenticator.setDisplayName(authenticatorInfo .get(ApplicationConstants.IDP_AUTHENTICATOR_DISPLAY_NAME)); + localAuthenticator.setDefinedByType(DefinedByType.valueOf( + authenticatorInfo.get(ApplicationConstants.IDP_AUTHENTICATOR_DEFINED_BY_TYPE))); stepLocalAuth.get(step).add(localAuthenticator); } else { Map> stepFedIdps = stepFedIdPAuthenticators @@ -3106,6 +3118,8 @@ private LocalAndOutboundAuthenticationConfig getLocalAndOutboundAuthenticationCo .get(ApplicationConstants.IDP_AUTHENTICATOR_NAME)); fedAuthenticator.setDisplayName(authenticatorInfo .get(ApplicationConstants.IDP_AUTHENTICATOR_DISPLAY_NAME)); + fedAuthenticator.setDefinedByType(DefinedByType.valueOf( + authenticatorInfo.get(ApplicationConstants.IDP_AUTHENTICATOR_DEFINED_BY_TYPE))); idpAuths.add(fedAuthenticator); } @@ -5016,6 +5030,7 @@ private Map getAuthenticatorInfo(Connection conn, int tenantId, returnData.put(ApplicationConstants.IDP_AUTHENTICATOR_NAME, rs.getString(2)); returnData .put(ApplicationConstants.IDP_AUTHENTICATOR_DISPLAY_NAME, rs.getString(3)); + returnData.put(ApplicationConstants.IDP_AUTHENTICATOR_DEFINED_BY_TYPE, rs.getString(4)); } } finally { IdentityApplicationManagementUtil.closeStatement(prepStmt); @@ -5032,13 +5047,13 @@ private Map getAuthenticatorInfo(Connection conn, int tenantId, * @return * @throws SQLException */ - private int addAuthenticator(Connection conn, int tenantId, String idpName, - String authenticatorName, String authenticatorDispalyName) throws SQLException { + private int addAuthenticator(Connection conn, int tenantId, String idpName, String authenticatorName, + String authenticatorDispalyName, String definedByType) throws SQLException { 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 +5065,7 @@ private int addAuthenticator(Connection conn, int tenantId, String idpName, prepStmt.setString(4, authenticatorName); prepStmt.setString(5, "1"); prepStmt.setString(6, authenticatorDispalyName); + prepStmt.setString(7, definedByType); prepStmt.execute(); rs = prepStmt.getGeneratedKeys(); if (rs.next()) { @@ -6552,4 +6568,24 @@ public List getTrustedApps(PlatformType platformType) throws Identit } return trustedApps; } + + private void onDemandMigrationForDefinedByType(Connection conn, int tenantId, int authenticatorId, + String authenticatorDefinedByType) throws SQLException { + + PreparedStatement prepStmt = null; + ResultSet rs = null; + String sqlStmt = ApplicationMgtDBQueries.UPDATE_AUTHENTICATOR_DEFINED_BY_TYPE; + + try { + String dbProductName = conn.getMetaData().getDatabaseProductName(); + prepStmt = conn.prepareStatement(sqlStmt, new String[] { + DBUtils.getConvertedAutoGeneratedColumnName(dbProductName, "ID")}); + prepStmt.setString(1, authenticatorDefinedByType); + prepStmt.setInt(2, authenticatorId); + prepStmt.setInt(3, tenantId); + prepStmt.execute(); + } finally { + IdentityApplicationManagementUtil.closeStatement(prepStmt); + } + } } diff --git a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationMgtDBQueries.java b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationMgtDBQueries.java index d5818025a738..91802d5c48cf 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationMgtDBQueries.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationMgtDBQueries.java @@ -289,11 +289,14 @@ public class ApplicationMgtDBQueries { public static final String LOAD_IDP_AUTHENTICATOR_ID = "SELECT A.ID FROM IDP_AUTHENTICATOR A JOIN IDP B ON A" + ".IDP_ID= B.ID WHERE A.NAME =? AND B.NAME=? AND ((A.TENANT_ID =? AND B.TENANT_ID =?) OR (B.TENANT_ID=? " + "AND B.NAME LIKE 'SHARED_%'))"; - public static final String LOAD_IDP_AND_AUTHENTICATOR_NAMES = "SELECT A.NAME, B.NAME, " + - "B.DISPLAY_NAME FROM IDP A JOIN IDP_AUTHENTICATOR B ON A.ID = B.IDP_ID WHERE B.ID =? AND ((A.TENANT_ID =?" + + public static final String LOAD_IDP_AND_AUTHENTICATOR_NAMES = "SELECT A.NAME, B.NAME, B.DISPLAY_NAME," + + " B.DEFINED_BY FROM IDP A JOIN IDP_AUTHENTICATOR B ON A.ID = B.IDP_ID WHERE B.ID =? AND ((A.TENANT_ID =?" + " AND B.TENANT_ID =?) OR (A.TENANT_ID=? AND A.NAME LIKE 'SHARED_%' AND B.TENANT_ID=?))"; public static final String STORE_LOCAL_AUTHENTICATOR = "INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME," + - "IS_ENABLED, DISPLAY_NAME) VALUES (?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?)"; + "IS_ENABLED, DISPLAY_NAME, DEFINED_BY) VALUES " + + "(?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?, ?)"; + public static final String UPDATE_AUTHENTICATOR_DEFINED_BY_TYPE = "UPDATE IDP_AUTHENTICATOR SET " + + "DEFINED_BY= ? WHERE ID = ? AND TENANT_ID = ?"; public static final String GET_SP_METADATA_BY_SP_ID = "SELECT ID, NAME, VALUE, DISPLAY_NAME FROM SP_METADATA " + "WHERE SP_ID = ?"; 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..a6ee6a7b45c2 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 @@ -44,6 +44,7 @@ import org.wso2.carbon.identity.application.common.model.RoleMapping; import org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants; import org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil; +import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; import org.wso2.carbon.identity.base.IdentityConstants; import org.wso2.carbon.identity.core.ConnectorConfig; import org.wso2.carbon.identity.core.ConnectorException; @@ -1148,6 +1149,7 @@ private FederatedAuthenticatorConfig[] getFederatedAuthenticatorConfigs( } authnConfig.setDisplayName(rs.getString("DISPLAY_NAME")); + authnConfig.setDefinedByType(DefinedByType.valueOf(rs.getString("DEFINED_BY"))); if (defaultAuthName != null && authnConfig.getName().equals(defaultAuthName)) { federatedIdp.getDefaultAuthenticatorConfig().setDisplayName(authnConfig.getDisplayName()); @@ -1424,6 +1426,7 @@ public void addFederatedAuthenticatorConfig(FederatedAuthenticatorConfig authnCo } prepStmt1.setString(4, authnConfig.getName()); prepStmt1.setString(5, authnConfig.getDisplayName()); + prepStmt1.setString(6, authnConfig.getDefinedByType().toString()); prepStmt1.execute(); int authnId = getAuthenticatorIdentifier(dbConnection, idpId, authnConfig.getName()); @@ -2330,6 +2333,7 @@ private FederatedAuthenticatorConfig buildSAMLProperties(IdentityProvider identi if (samlFederatedAuthConfig == null) { samlFederatedAuthConfig = new FederatedAuthenticatorConfig(); samlFederatedAuthConfig.setName(IdentityApplicationConstants.Authenticator.SAML2SSO.NAME); + samlFederatedAuthConfig.setDefinedByType(DefinedByType.SYSTEM); } List propertiesList = new ArrayList<>(); @@ -2713,6 +2717,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String if (openIdFedAuthn == null) { openIdFedAuthn = new FederatedAuthenticatorConfig(); openIdFedAuthn.setName(IdentityApplicationConstants.Authenticator.OpenID.NAME); + openIdFedAuthn.setDefinedByType(DefinedByType.SYSTEM); } propertiesList = new ArrayList<>(Arrays.asList(openIdFedAuthn.getProperties())); if (IdentityApplicationManagementUtil.getProperty(openIdFedAuthn.getProperties(), @@ -2735,6 +2740,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String if (oauth1FedAuthn == null) { oauth1FedAuthn = new FederatedAuthenticatorConfig(); oauth1FedAuthn.setName(IdentityApplicationConstants.OAuth10A.NAME); + oauth1FedAuthn.setDefinedByType(DefinedByType.SYSTEM); } propertiesList = new ArrayList<>(Arrays.asList(oauth1FedAuthn.getProperties())); if (IdentityApplicationManagementUtil.getProperty(oauth1FedAuthn.getProperties(), @@ -2770,6 +2776,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String if (oidcFedAuthn == null) { oidcFedAuthn = new FederatedAuthenticatorConfig(); oidcFedAuthn.setName(IdentityApplicationConstants.Authenticator.OIDC.NAME); + oidcFedAuthn.setDefinedByType(DefinedByType.SYSTEM); } propertiesList = new ArrayList<>(); @@ -2841,6 +2848,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String if (passiveSTSFedAuthn == null) { passiveSTSFedAuthn = new FederatedAuthenticatorConfig(); passiveSTSFedAuthn.setName(IdentityApplicationConstants.Authenticator.PassiveSTS.NAME); + passiveSTSFedAuthn.setDefinedByType(DefinedByType.SYSTEM); } propertiesList = new ArrayList<>(); @@ -2880,6 +2888,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String if (stsFedAuthn == null) { stsFedAuthn = new FederatedAuthenticatorConfig(); stsFedAuthn.setName(IdentityApplicationConstants.Authenticator.WSTrust.NAME); + stsFedAuthn.setDefinedByType(DefinedByType.SYSTEM); } propertiesList = new ArrayList<>(Arrays.asList(stsFedAuthn.getProperties())); if (IdentityApplicationManagementUtil.getProperty(stsFedAuthn.getProperties(), @@ -2894,6 +2903,7 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String FederatedAuthenticatorConfig sessionTimeoutConfig = new FederatedAuthenticatorConfig(); sessionTimeoutConfig.setName(IdentityApplicationConstants.NAME); + sessionTimeoutConfig.setDefinedByType(DefinedByType.SYSTEM); propertiesList = new ArrayList<>(Arrays.asList(sessionTimeoutConfig.getProperties())); @@ -3409,6 +3419,7 @@ public IdentityProvider getIdPByAuthenticatorPropertyValue(Connection dbConnecti String roleClaimUri = rs.getString("ROLE_CLAIM_URI"); String defaultAuthenticatorName = rs.getString("DEFAULT_AUTHENTICATOR_NAME"); + String defaultAuthenticatorDefinedByType = rs.getString("DEFINED_BY"); String defaultProvisioningConnectorConfigName = rs.getString("DEFAULT_PRO_CONNECTOR_NAME"); federatedIdp.setIdentityProviderDescription(rs.getString("DESCRIPTION")); @@ -3443,6 +3454,8 @@ public IdentityProvider getIdPByAuthenticatorPropertyValue(Connection dbConnecti if (defaultAuthenticatorName != null) { FederatedAuthenticatorConfig defaultAuthenticator = new FederatedAuthenticatorConfig(); defaultAuthenticator.setName(defaultAuthenticatorName); + defaultAuthenticator.setDefinedByType(DefinedByType.valueOf( + defaultAuthenticatorDefinedByType)); federatedIdp.setDefaultAuthenticatorConfig(defaultAuthenticator); } diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java index 0cfbadd94eac..16123d426568 100644 --- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java +++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java @@ -235,7 +235,7 @@ public static class SQLQueries { public static final String GET_IDP_ID_BY_NAME_SQL = "SELECT ID " + "FROM IDP WHERE TENANT_ID=? AND NAME=?"; - public static final String GET_ALL_IDP_AUTH_SQL = "SELECT ID, NAME, IS_ENABLED, DISPLAY_NAME FROM " + + public static final String GET_ALL_IDP_AUTH_SQL = "SELECT ID, NAME, IS_ENABLED, DISPLAY_NAME, DEFINED_BY FROM " + "IDP_AUTHENTICATOR WHERE IDP_ID = ?"; public static final String GET_IDP_AUTH_SQL = "SELECT ID FROM IDP_AUTHENTICATOR WHERE IDP_ID = ? AND NAME = ?"; @@ -357,7 +357,7 @@ public static class SQLQueries { public static final String TRUSTED_TOKEN_ISSUER_FILTER_SQL = "IDP_METADATA.\"VALUE\" = 'true' AND "; public static final String ADD_IDP_AUTH_SQL = "INSERT INTO IDP_AUTHENTICATOR " + - "(IDP_ID, TENANT_ID, IS_ENABLED, NAME, DISPLAY_NAME) VALUES (?,?,?,?,?)"; + "(IDP_ID, TENANT_ID, IS_ENABLED, NAME, DISPLAY_NAME, DEFINED_BY) VALUES (?,?,?,?,?,?)"; public static final String DELETE_IDP_AUTH_SQL = "DELETE FROM IDP_AUTHENTICATOR WHERE IDP_ID=? AND NAME=?"; @@ -448,7 +448,8 @@ public static class SQLQueries { "idp.ROLE_CLAIM_URI, idp.DEFAULT_AUTHENTICATOR_NAME, idp.DEFAULT_PRO_CONNECTOR_NAME, " + "idp.DESCRIPTION, " + "idp.IS_FEDERATION_HUB, idp.IS_LOCAL_CLAIM_DIALECT, idp.PROVISIONING_ROLE, idp.IS_ENABLED, " + - "idp.DISPLAY_NAME " + + "idp.DISPLAY_NAME, " + + "idp_auth.DEFINED_BY " + "FROM IDP idp INNER JOIN IDP_AUTHENTICATOR idp_auth ON idp.ID = idp_auth.IDP_ID INNER JOIN " + "IDP_AUTHENTICATOR_PROPERTY idp_auth_pro ON idp_auth.ID = idp_auth_pro.AUTHENTICATOR_ID " + "WHERE idp_auth_pro.PROPERTY_KEY =? AND idp_auth_pro.PROPERTY_VALUE = ? AND idp_auth_pro.TENANT_ID =?"; @@ -460,7 +461,8 @@ public static class SQLQueries { "idp.ROLE_CLAIM_URI, idp.DEFAULT_AUTHENTICATOR_NAME, idp.DEFAULT_PRO_CONNECTOR_NAME, " + "idp.DESCRIPTION, " + "idp.IS_FEDERATION_HUB, idp.IS_LOCAL_CLAIM_DIALECT, idp.PROVISIONING_ROLE, idp.IS_ENABLED, " + - "idp.DISPLAY_NAME " + + "idp.DISPLAY_NAME, " + + "idp_auth.DEFINED_BY " + "FROM IDP idp INNER JOIN IDP_AUTHENTICATOR idp_auth ON idp.ID = idp_auth.IDP_ID INNER JOIN " + "IDP_AUTHENTICATOR_PROPERTY idp_auth_pro ON idp_auth.ID = idp_auth_pro.AUTHENTICATOR_ID " + "WHERE idp_auth_pro.PROPERTY_KEY =? AND idp_auth_pro.PROPERTY_VALUE = ? AND idp_auth_pro.TENANT_ID " + diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql index 7facf6a4d8a0..1b460105bd8a 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql @@ -864,6 +864,7 @@ CREATE TABLE IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE) diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql index 6da58b00a5cd..05bd8716b096 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql @@ -605,6 +605,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE); diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql index cc3ce1c9ad1e..96ec914e824c 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql @@ -672,6 +672,7 @@ CREATE TABLE IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql index 8e827ea7552d..f17118830358 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql @@ -711,6 +711,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR(1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP (ID) diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql index f09ae2e4513b..2955b4581747 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql @@ -624,6 +624,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql index 6f9e84488ed2..9abf1c068f8c 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql @@ -1001,6 +1001,7 @@ CREATE TABLE IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE) diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql index 8f06bfedecd9..deba4fac96f1 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql @@ -883,6 +883,7 @@ CREATE TABLE IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE) diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql index 20793bca2de2..be4f0b8ee7be 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql @@ -733,6 +733,7 @@ CREATE TABLE IDP_AUTHENTICATOR ( NAME VARCHAR(255) NOT NULL, IS_ENABLED CHAR (1) DEFAULT '1', DISPLAY_NAME VARCHAR(255), + DEFINED_BY VARCHAR(255) NOT NULL, PRIMARY KEY (ID), UNIQUE (TENANT_ID, IDP_ID, NAME), FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);