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 f2f848dd09c1..086dc50df98a 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 @@ -2901,8 +2901,12 @@ private void fillResidentIdpProperties(IdentityProvider identityProvider, String public IdentityProvider getIDPbyId(Connection dbConnection, int idpId, int tenantId, String tenantDomain) throws IdentityProviderManagementException { - return getIDP(dbConnection, null, idpId, null, tenantId, tenantDomain); - + IdentityProvider idp = getIDP(dbConnection, null, idpId, null, tenantId, tenantDomain); + if (idp != null + && IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME.equals(idp.getIdentityProviderName())) { + fillResidentIdpProperties(idp, tenantDomain); + } + return idp; } /** @@ -3396,6 +3400,7 @@ public IdentityProvider getIdPByAuthenticatorPropertyValue(Connection dbConnecti getIdentityPropertiesByIdpId(dbConnection, Integer.parseInt(rs.getString("ID")))); if (IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME.equals(idPName)) { propertyList = resolveConnectorProperties(propertyList, tenantDomain); + fillResidentIdpProperties(federatedIdp, tenantDomain); } federatedIdp.setIdpProperties(propertyList.toArray(new IdentityProviderProperty[0])); @@ -3558,6 +3563,7 @@ public IdentityProvider getIdPByAuthenticatorPropertyValue(Connection dbConnecti if (IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME.equals(idPName)) { propertyList = resolveConnectorProperties(propertyList, tenantDomain); + fillResidentIdpProperties(federatedIdp, tenantDomain); } federatedIdp.setIdpProperties(propertyList.toArray(new IdentityProviderProperty[0]));