Search in sources :

Example 1 with OIDCSessionParticipantCacheKey

use of org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey in project identity-inbound-auth-oauth by wso2-extensions.

the class OIDCSessionManager method removeOIDCSessionState.

/**
 * Removes the session against the given session id.
 *
 * @param sessionId session id value
 * @param loginTenantDomain login tenant domain
 */
public void removeOIDCSessionState(String sessionId, String loginTenantDomain) {
    String tenantDomain = resolveCacheTenantDomain(loginTenantDomain);
    OIDCSessionParticipantCacheKey cacheKey = new OIDCSessionParticipantCacheKey();
    cacheKey.setSessionID(sessionId);
    OIDCSessionParticipantCache.getInstance().clearCacheEntry(cacheKey, tenantDomain);
}
Also used : OIDCSessionParticipantCacheKey(org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey)

Example 2 with OIDCSessionParticipantCacheKey

use of org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey in project identity-inbound-auth-oauth by wso2-extensions.

the class OIDCSessionManager method storeOIDCSessionState.

/**
 * Stores the session state against the provided session id.
 *
 * @param sessionId    session id value
 * @param sessionState OIDCSessionState instance
 * @param loginTenantDomain login tenant domain
 */
public void storeOIDCSessionState(String sessionId, OIDCSessionState sessionState, String loginTenantDomain) {
    String tenantDomain = resolveCacheTenantDomain(loginTenantDomain);
    OIDCSessionParticipantCacheKey cacheKey = new OIDCSessionParticipantCacheKey();
    cacheKey.setSessionID(sessionId);
    OIDCSessionParticipantCacheEntry cacheEntry = new OIDCSessionParticipantCacheEntry();
    cacheEntry.setSessionState(sessionState);
    cacheEntry.setTenantDomain(tenantDomain);
    OIDCSessionParticipantCache.getInstance().addToCache(cacheKey, cacheEntry, tenantDomain);
}
Also used : OIDCSessionParticipantCacheEntry(org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheEntry) OIDCSessionParticipantCacheKey(org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey)

Example 3 with OIDCSessionParticipantCacheKey

use of org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey in project identity-inbound-auth-oauth by wso2-extensions.

the class OIDCSessionManager method getOIDCSessionState.

/**
 * Retrieves session state for the given session id.
 *
 * @param sessionId session id value
 * @param loginTenantDomain login tenant domain
 * @return OIDCSessionState instance
 */
public OIDCSessionState getOIDCSessionState(String sessionId, String loginTenantDomain) {
    String tenantDomain = resolveCacheTenantDomain(loginTenantDomain);
    OIDCSessionParticipantCacheKey cacheKey = new OIDCSessionParticipantCacheKey();
    cacheKey.setSessionID(sessionId);
    OIDCSessionParticipantCacheEntry cacheEntry = OIDCSessionParticipantCache.getInstance().getValueFromCache(cacheKey, tenantDomain);
    return cacheEntry == null ? null : cacheEntry.getSessionState();
}
Also used : OIDCSessionParticipantCacheEntry(org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheEntry) OIDCSessionParticipantCacheKey(org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey)

Aggregations

OIDCSessionParticipantCacheKey (org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheKey)3 OIDCSessionParticipantCacheEntry (org.wso2.carbon.identity.oidc.session.cache.OIDCSessionParticipantCacheEntry)2