Skip to content

Commit

Permalink
Stop adding unwanted delete queries in IDN_AUTH_SESSION_STORE
Browse files Browse the repository at this point in the history
  • Loading branch information
sadilchamishka committed Apr 11, 2023
1 parent 5df8704 commit 2dd4628
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
Expand All @@ -30,6 +31,7 @@
import org.wso2.carbon.identity.oauth.OAuthUtil;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCache;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheKey;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
import org.wso2.carbon.identity.oauth.util.ClaimCache;
import org.wso2.carbon.identity.oauth.util.ClaimCacheKey;
import org.wso2.carbon.identity.oauth.util.ClaimMetaDataCache;
Expand Down Expand Up @@ -315,6 +317,10 @@ private void removeAccessTokensFromCache(Set<AccessTokenDO> accessTokenDOSet) {

if (CollectionUtils.isNotEmpty(accessTokenDOSet)) {
for (AccessTokenDO accessTokenDO : accessTokenDOSet) {
if (StringUtils.equalsIgnoreCase(OAuthConstants.GrantTypes.PASSWORD,
accessTokenDO.getGrantType())) {
continue;
}
String accessToken = accessTokenDO.getAccessToken();
String tokenId = accessTokenDO.getTokenId();
AuthorizationGrantCacheKey cacheKey = new AuthorizationGrantCacheKey(accessToken);
Expand Down

0 comments on commit 2dd4628

Please sign in to comment.