Skip to content

Commit ee1eb06

Browse files
committed
/authenticators/system
1 parent 8ba2cce commit ee1eb06

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/constant/AuthenticatorMgtSQLConstants.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ public static class Query {
6666
":NAME;, :IS_ENABLED;, :DEFINED_BY;, :AUTHENTICATION_TYPE;, :DISPLAY_NAME;, " +
6767
":IMAGE_URL;, :DESCRIPTION;)";
6868
public static final String ADD_SYSTEM_LOCAL_AUTHENTICATOR_SQL = "INSERT INTO IDP_AUTHENTICATOR " +
69-
"(TENANT_ID, IDP_ID, NAME, IS_ENABLED, DEFINED_BY, AMR_VALUE, DISPLAY_NAME) " +
69+
"(TENANT_ID, IDP_ID, NAME, IS_ENABLED, DEFINED_BY, AMR_VALUE, AUTHENTICATION_TYPE, DISPLAY_NAME) " +
7070
"VALUES " +
71-
"(:TENANT_ID, " +
71+
"(:TENANT_ID;, " +
7272
"(SELECT ID FROM IDP WHERE NAME = :IDP_NAME; AND TENANT_ID = :TENANT_ID;), " +
73-
":NAME;, :IS_ENABLED;, :DEFINED_BY;, :AMR_VALUE;, :DISPLAY_NAME;)";
73+
":NAME;, :IS_ENABLED;, :DEFINED_BY;, :AMR_VALUE;, :AUTHENTICATION_TYPE;, :DISPLAY_NAME;)";
7474
public static final String UPDATE_AUTHENTICATOR_SQL = "UPDATE IDP_AUTHENTICATOR SET IS_ENABLED = " +
7575
":IS_ENABLED;, DISPLAY_NAME = :DISPLAY_NAME;, IMAGE_URL = :IMAGE_URL;, DESCRIPTION = :DESCRIPTION;, " +
7676
"AMR_VALUE = :AMR_VALUE" +

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/dao/impl/AuthenticatorManagementDAOImpl.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public boolean isExistingAuthenticatorName(String authenticatorName, int tenantI
266266
public LocalAuthenticatorConfig addSystemLocalAuthenticator(LocalAuthenticatorConfig authenticatorConfig, int tenantId) throws AuthenticatorMgtServerException {
267267
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
268268
try {
269-
int authenticatorConfigID = jdbcTemplate.withTransaction(template ->
269+
jdbcTemplate.withTransaction(template ->
270270
template.executeInsert(Query.ADD_SYSTEM_LOCAL_AUTHENTICATOR_SQL,
271271
statement -> {
272272
statement.setString(Column.NAME, authenticatorConfig.getName());
@@ -280,11 +280,6 @@ public LocalAuthenticatorConfig addSystemLocalAuthenticator(LocalAuthenticatorCo
280280
statement.setInt(Column.TENANT_ID, tenantId);
281281
}, null, true));
282282

283-
if (authenticatorConfigID == 0) {
284-
authenticatorConfigID = getAuthenticatorEntryId(authenticatorConfig.getName(), tenantId);
285-
}
286-
addAuthenticatorProperty(authenticatorConfigID, authenticatorConfig.getProperties(), tenantId);
287-
288283
return getSystemLocalAuthenticatorByName(authenticatorConfig.getName(), tenantId);
289284
} catch (TransactionException e) {
290285
throw buildServerException(AuthenticatorMgtError.ERROR_WHILE_ADDING_AUTHENTICATOR, e);

0 commit comments

Comments
 (0)