diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/store/UserSessionStore.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/store/UserSessionStore.java index 1957b2f98fe8..7105f39e7fec 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/store/UserSessionStore.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/store/UserSessionStore.java @@ -47,6 +47,8 @@ import java.util.Set; import java.util.concurrent.TimeUnit; +import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.LOCAL_IDP_NAME; + /** * Class to store and retrieve user related data. */ @@ -298,7 +300,10 @@ public int getIdPId(String idPName) throws UserSessionException { public int getIdPId(String idpName, int tenantId) throws UserSessionException { int idPId = -1; - if (idpName.equals("LOCAL")) { + if (StringUtils.isBlank(idpName)) { + throw new UserSessionException("Blank IDP Name is provided to retrieve IdP id of tenant ID: " + tenantId); + } + if (StringUtils.equals(LOCAL_IDP_NAME, idpName)) { return idPId; } try (Connection connection = IdentityDatabaseUtil.getDBConnection(false)) {