Search in sources :

Example 1 with MapStorage

use of org.keycloak.models.map.storage.MapStorage in project keycloak by keycloak.

the class MapAuthorizationStoreFactory method create.

@Override
public StoreFactory create(KeycloakSession session) {
    MapStorageProviderFactory storageProviderFactory = (MapStorageProviderFactory) getComponentFactory(session.getKeycloakSessionFactory(), MapStorageProvider.class, storageConfigScope, MapStorageSpi.NAME);
    final MapStorageProvider mapStorageProvider = storageProviderFactory.create(session);
    AuthorizationProvider provider = session.getProvider(AuthorizationProvider.class);
    MapStorage permissionTicketStore;
    MapStorage policyStore;
    MapStorage resourceServerStore;
    MapStorage resourceStore;
    MapStorage scopeStore;
    permissionTicketStore = mapStorageProvider.getStorage(PermissionTicket.class);
    policyStore = mapStorageProvider.getStorage(Policy.class);
    resourceServerStore = mapStorageProvider.getStorage(ResourceServer.class);
    resourceStore = mapStorageProvider.getStorage(Resource.class);
    scopeStore = mapStorageProvider.getStorage(Scope.class);
    return new MapAuthorizationStore(session, permissionTicketStore, policyStore, resourceServerStore, resourceStore, scopeStore, provider);
}
Also used : Policy(org.keycloak.authorization.model.Policy) PermissionTicket(org.keycloak.authorization.model.PermissionTicket) Scope(org.keycloak.authorization.model.Scope) AuthorizationProvider(org.keycloak.authorization.AuthorizationProvider) Resource(org.keycloak.authorization.model.Resource) MapStorageProviderFactory(org.keycloak.models.map.storage.MapStorageProviderFactory) ResourceServer(org.keycloak.authorization.model.ResourceServer) MapStorage(org.keycloak.models.map.storage.MapStorage) MapStorageProvider(org.keycloak.models.map.storage.MapStorageProvider)

Example 2 with MapStorage

use of org.keycloak.models.map.storage.MapStorage in project keycloak by keycloak.

the class MapUserSessionProviderFactory method create.

@Override
public MapUserSessionProvider create(KeycloakSession session) {
    MapStorageProviderFactory storageProviderFactoryUs = (MapStorageProviderFactory) getComponentFactory(session.getKeycloakSessionFactory(), MapStorageProvider.class, storageConfigScopeUserSessions, MapStorageSpi.NAME);
    final MapStorageProvider factoryUs = storageProviderFactoryUs.create(session);
    MapStorage userSessionStore = factoryUs.getStorage(UserSessionModel.class);
    MapStorageProviderFactory storageProviderFactoryCs = (MapStorageProviderFactory) getComponentFactory(session.getKeycloakSessionFactory(), MapStorageProvider.class, storageConfigScopeClientSessions, MapStorageSpi.NAME);
    final MapStorageProvider factoryCs = storageProviderFactoryCs.create(session);
    MapStorage clientSessionStore = factoryCs.getStorage(AuthenticatedClientSessionModel.class);
    return new MapUserSessionProvider(session, userSessionStore, clientSessionStore);
}
Also used : MapStorageProviderFactory(org.keycloak.models.map.storage.MapStorageProviderFactory) MapStorage(org.keycloak.models.map.storage.MapStorage) MapStorageProvider(org.keycloak.models.map.storage.MapStorageProvider)

Aggregations

MapStorage (org.keycloak.models.map.storage.MapStorage)2 MapStorageProvider (org.keycloak.models.map.storage.MapStorageProvider)2 MapStorageProviderFactory (org.keycloak.models.map.storage.MapStorageProviderFactory)2 AuthorizationProvider (org.keycloak.authorization.AuthorizationProvider)1 PermissionTicket (org.keycloak.authorization.model.PermissionTicket)1 Policy (org.keycloak.authorization.model.Policy)1 Resource (org.keycloak.authorization.model.Resource)1 ResourceServer (org.keycloak.authorization.model.ResourceServer)1 Scope (org.keycloak.authorization.model.Scope)1