diff --git a/components/ipvalidate-handler/src/main/java/com/wso2telco/dep/ipvalidate/handler/validation/dao/IPValidationDao.java b/components/ipvalidate-handler/src/main/java/com/wso2telco/dep/ipvalidate/handler/validation/dao/IPValidationDao.java index 70379ae59..098a555fb 100644 --- a/components/ipvalidate-handler/src/main/java/com/wso2telco/dep/ipvalidate/handler/validation/dao/IPValidationDao.java +++ b/components/ipvalidate-handler/src/main/java/com/wso2telco/dep/ipvalidate/handler/validation/dao/IPValidationDao.java @@ -84,7 +84,7 @@ public String getClientToken(String clientId) throws Exception { ResultSet results = null; String clientIdToken = null; - String sql = "select ACCESS_TOKEN from idn_oauth2_access_token where CONSUMER_KEY_ID = ? and TOKEN_STATE = 'ACTIVE';"; + String sql = "select ACCESS_TOKEN from idn_oauth2_access_token where CONSUMER_KEY_ID = ? and TOKEN_STATE = 'ACTIVE' and GRANT_TYPE = 'client_credentials'"; try { conn = DbUtils.getDbConnection(DataSourceNames.WSO2AM_DB); ps = conn.prepareStatement(sql);