use of org.wso2.carbon.identity.oauth2.internal.cache.OAuthUserConsentedScopeCacheEntry in project identity-inbound-auth-oauth by wso2-extensions.
the class CacheBackedOAuthUserConsentedScopesDAOImpl method getUserConsentForApplication.
@Override
public UserApplicationScopeConsentDO getUserConsentForApplication(String userId, String appId, int tenantId) throws IdentityOAuth2ScopeConsentException {
OAuthUserConsentedScopeCacheEntry entry = cache.getValueFromCache(userId, tenantId);
if (entry != null && entry.getAppID().equals(appId)) {
return entry.getUserApplicationScopeConsentDO();
}
UserApplicationScopeConsentDO userConsent = dao.getUserConsentForApplication(userId, appId, tenantId);
cache.addToCache(userId, new OAuthUserConsentedScopeCacheEntry(appId, userConsent), tenantId);
return userConsent;
}
Aggregations