use of org.wso2.carbon.identity.openidconnect.cache.OIDCScopeClaimCacheEntry in project identity-inbound-auth-oauth by wso2-extensions.
the class CacheBackedScopeClaimMappingDAOImpl method getScopeNames.
@Override
public List<String> getScopeNames(int tenantId) throws IdentityOAuth2Exception {
OIDCScopeClaimCacheEntry oidcScopeClaimCacheEntry = oidcScopeClaimCache.getScopeClaimMap(tenantId);
oidcScopeClaimCacheEntry = loadOIDCScopeClaims(tenantId, oidcScopeClaimCacheEntry);
List<String> scopes = new ArrayList<>();
for (ScopeDTO scopeDTO : oidcScopeClaimCacheEntry.getScopeClaimMapping()) {
scopes.add(scopeDTO.getName());
}
return scopes;
}
use of org.wso2.carbon.identity.openidconnect.cache.OIDCScopeClaimCacheEntry in project identity-inbound-auth-oauth by wso2-extensions.
the class CacheBackedScopeClaimMappingDAOImpl method getScopes.
@Override
public List<ScopeDTO> getScopes(int tenantId) throws IdentityOAuth2Exception {
OIDCScopeClaimCacheEntry oidcScopeClaimCacheEntry = oidcScopeClaimCache.getScopeClaimMap(tenantId);
oidcScopeClaimCacheEntry = loadOIDCScopeClaims(tenantId, oidcScopeClaimCacheEntry);
return oidcScopeClaimCacheEntry.getScopeClaimMapping();
}
use of org.wso2.carbon.identity.openidconnect.cache.OIDCScopeClaimCacheEntry in project identity-inbound-auth-oauth by wso2-extensions.
the class CacheBackedScopeClaimMappingDAOImpl method loadOIDCScopeClaims.
private OIDCScopeClaimCacheEntry loadOIDCScopeClaims(int tenantId, OIDCScopeClaimCacheEntry oidcScopeClaimCacheEntry) throws IdentityOAuth2Exception {
if (oidcScopeClaimCacheEntry == null || oidcScopeClaimCacheEntry.getScopeClaimMapping().size() == 0) {
if (log.isDebugEnabled()) {
log.debug("Cache miss for OIDC scopes claims mapping for tenant: " + tenantId);
}
oidcScopeClaimCacheEntry = new OIDCScopeClaimCacheEntry();
List<ScopeDTO> scopeClaims = scopeClaimMappingDAOImpl.getScopes(tenantId);
oidcScopeClaimCacheEntry.setScopeClaimMapping(scopeClaims);
oidcScopeClaimCache.addScopeClaimMap(tenantId, oidcScopeClaimCacheEntry);
if (log.isDebugEnabled()) {
log.debug("OIDC scopes and mapped claims are loaded from the database and inserted to the cache for " + "the tenant : " + tenantId);
}
}
return oidcScopeClaimCacheEntry;
}
Aggregations