Search in sources :

Example 1 with RootAuthenticationSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.RootAuthenticationSessionEntity in project keycloak by keycloak.

the class InfinispanAuthenticationSessionProvider method createRootAuthenticationSession.

@Override
public RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm, String id) {
    RootAuthenticationSessionEntity entity = new RootAuthenticationSessionEntity();
    entity.setId(id);
    entity.setRealmId(realm.getId());
    entity.setTimestamp(Time.currentTime());
    int expirationSeconds = RealmInfoUtil.getDettachedClientSessionLifespan(realm);
    tx.put(cache, id, entity, expirationSeconds, TimeUnit.SECONDS);
    return wrap(realm, entity);
}
Also used : RootAuthenticationSessionEntity(org.keycloak.models.sessions.infinispan.entities.RootAuthenticationSessionEntity)

Example 2 with RootAuthenticationSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.RootAuthenticationSessionEntity in project keycloak by keycloak.

the class InfinispanAuthenticationSessionProviderFactory method updateAuthNotes.

private void updateAuthNotes(ClusterEvent clEvent) {
    if (!(clEvent instanceof AuthenticationSessionAuthNoteUpdateEvent)) {
        return;
    }
    AuthenticationSessionAuthNoteUpdateEvent event = (AuthenticationSessionAuthNoteUpdateEvent) clEvent;
    RootAuthenticationSessionEntity authSession = this.authSessionsCache.get(event.getAuthSessionId());
    updateAuthSession(authSession, event.getTabId(), event.getAuthNotesFragment());
}
Also used : AuthenticationSessionAuthNoteUpdateEvent(org.keycloak.models.cache.infinispan.events.AuthenticationSessionAuthNoteUpdateEvent) RootAuthenticationSessionEntity(org.keycloak.models.sessions.infinispan.entities.RootAuthenticationSessionEntity)

Aggregations

RootAuthenticationSessionEntity (org.keycloak.models.sessions.infinispan.entities.RootAuthenticationSessionEntity)2 AuthenticationSessionAuthNoteUpdateEvent (org.keycloak.models.cache.infinispan.events.AuthenticationSessionAuthNoteUpdateEvent)1