diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
index a399c5f..64ed9ac 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
@@ -16,6 +16,7 @@
 import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import com.mchange.rmi.NotAuthorizedException;
 // import com.novell.ldap.*; search() funktioniert nicht korrekt, ausgewechselt gegen unboundID's Bibliothek 20.04.17/FB
 //Using JAR from unboundID:
 import com.unboundid.ldap.sdk.LDAPException;
@@ -30,7 +31,6 @@
 import de.ids_mannheim.korap.dao.AdminDao;
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.NotAuthorizedException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.exceptions.WrappedException;
 import de.ids_mannheim.korap.interfaces.AuthenticationIface;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/OpenIDconnectAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/OpenIDconnectAuthentication.java
deleted file mode 100644
index 549b4c7..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/OpenIDconnectAuthentication.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package de.ids_mannheim.korap.authentication;
-
-import java.text.ParseException;
-import java.util.Map;
-
-import com.nimbusds.jose.JOSEException;
-import com.nimbusds.jwt.SignedJWT;
-
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.FullConfiguration;
-import de.ids_mannheim.korap.config.JWTSigner;
-import de.ids_mannheim.korap.constant.TokenType;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.handlers.OAuthDb;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.security.context.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Element;
-
-/**
- * @author hanl
- * @date 12/11/2014
- */
-public class OpenIDconnectAuthentication implements AuthenticationIface {
-
-    private OAuthDb database;
-    private FullConfiguration config;
-
-
-    public OpenIDconnectAuthentication (FullConfiguration config,
-                                        PersistenceClient client) {
-        this.database = new OAuthDb(client);
-        this.config = config;
-    }
-
-
-    @Override
-    public TokenContext getTokenContext (String authToken)
-            throws KustvaktException {
-        return this.database.getContext(authToken);
-    }
-
-
-    @Override
-    public TokenContext createTokenContext (User user, Map<String, Object> attr)
-            throws KustvaktException {
-        String cl_secret = (String) attr.get(Attributes.CLIENT_SECRET);
-        if (cl_secret == null)
-            throw new KustvaktException(StatusCodes.REQUEST_INVALID);
-        attr.remove(cl_secret);
-        JWTSigner signer;
-        try {
-            signer = new JWTSigner(cl_secret.getBytes(), config.getIssuer(),
-                    config.getTokenTTL());
-        }
-        catch (JOSEException e1) {
-            // e1.printStackTrace();
-            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT,
-                    "Failed creating JWT.", e1);
-        }
-        TokenContext c = new TokenContext();
-        c.setUsername(user.getUsername());
-        SignedJWT jwt = signer.createJWT(user, attr);
-        try {
-            c.setExpirationTime(
-                    jwt.getJWTClaimsSet().getExpirationTime().getTime());
-        }
-        catch (ParseException e) {
-            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT);
-        }
-        c.setTokenType(getTokenType());
-        c.setToken(jwt.serialize());
-        CacheManager.getInstance().getCache("id_tokens")
-                .put(new Element(c.getToken(), c));
-        return c;
-    }
-
-
-    @Override
-    public void removeUserSession (String token) throws KustvaktException {
-        // emit token from cache only
-    }
-
-
-    @Override
-    public TokenContext refresh (TokenContext context)
-            throws KustvaktException {
-        throw new UnsupportedOperationException("method not supported");
-    }
-
-
-    @Override
-    public TokenType getTokenType () {
-        return TokenType.ID_TOKEN;
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java b/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
index 1479564..e1c9acd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
@@ -22,6 +22,7 @@
  * @author hanl
  * @date 13/01/2014
  */
+@Deprecated
 @Data
 public class JDBCClient extends PersistenceClient<NamedParameterJdbcTemplate> {
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/OAuthDb.java b/full/src/main/java/de/ids_mannheim/korap/handlers/OAuthDb.java
deleted file mode 100644
index 838b1c0..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/OAuthDb.java
+++ /dev/null
@@ -1,283 +0,0 @@
-package de.ids_mannheim.korap.handlers;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.util.List;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.dao.DataAccessException;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.ClientInfo;
-import de.ids_mannheim.korap.constant.TokenType;
-import de.ids_mannheim.korap.exceptions.DatabaseException;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.security.context.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.utils.BooleanUtils;
-import de.ids_mannheim.korap.utils.TimeUtils;
-import edu.emory.mathcs.backport.java.util.Collections;
-
-/**
- * Created by hanl on 7/14/14.
- */
-public class OAuthDb {
-
-    private static final Logger jlog = LogManager.getLogger(OAuthDb.class);
-    private NamedParameterJdbcTemplate jdbcTemplate;
-
-
-    public OAuthDb (PersistenceClient client) {
-        this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
-    }
-
-
-    public ClientInfo getClient (String clientid) {
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("cl", clientid);
-        String sql = "select * from oauth2_client where client_id=:cl;";
-
-        try {
-            return this.jdbcTemplate.queryForObject(sql, s,
-                    new RowMapper<ClientInfo>() {
-                        @Override
-                        public ClientInfo mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            ClientInfo info = new ClientInfo(rs
-                                    .getString("client_id"), rs
-                                    .getString("client_secret"));
-                            info.setId(rs.getInt("id"));
-                            info.setClient_type(rs.getString("client_type"));
-                            info.setRedirect_uri(rs.getString("redirect_uri"));
-                            info.setUrl(rs.getString("url"));
-                            info.setConfidential(rs
-                                    .getBoolean("is_confidential"));
-                            return info;
-                        }
-                    });
-        }
-        catch (EmptyResultDataAccessException ex) {
-            jlog.error(clientid+" client found "+ ex.fillInStackTrace());
-            return null;
-        }
-    }
-
-
-    // fixme: what to delete? difference client/application table?
-    public boolean revokeToken (String token) throws KustvaktException {
-        String sql = "delete from oauth2_access_token WHERE access_token=:token;";
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("token", token);
-        try {
-            return this.jdbcTemplate.update(sql, s) == 1;
-        }
-        catch (DataAccessException e) {
-            jlog.error("token could not be revoked", e.fillInStackTrace());
-            return false;
-        }
-    }
-
-
-    public boolean revokeAuthorization (ClientInfo info, User user) {
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("us", user.getId());
-        source.addValue("cls", info.getClient_secret());
-        source.addValue("clid", info.getClient_id());
-
-        String tokens = "delete from oauth2_access_token where user_id=:us and client_id in "
-                + "(select client_id from oauth2_client where client_id=:clid and client_secret=:cls);";
-
-        try {
-            this.jdbcTemplate.update(tokens, source);
-        }
-        catch (DataAccessException e) {
-            jlog.error("authorization could not be revoked for user "+
-                    user.getUsername());
-            return false;
-        }
-        //fixme: if int row not updated, false!!
-        return true;
-    }
-
-
-    public boolean addToken (String token, String refresh, Integer userid,
-            String client_id, String scopes, int expiration)
-            throws KustvaktException {
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("token", token);
-        s.addValue("rt", refresh);
-        s.addValue("ex", new Timestamp(TimeUtils.plusSeconds(expiration)
-                .getMillis()));
-        s.addValue("us", userid);
-        s.addValue("sc", scopes);
-        s.addValue("st", BooleanUtils.getBoolean(true));
-        s.addValue("cli", client_id);
-        String sql = "insert into oauth2_access_token (access_token, refresh_token, scopes, client_id, user_id, expiration, status) "
-                + "values (:token, :rt, :sc, :cli, :us, :ex, :st);";
-        try {
-            return this.jdbcTemplate.update(sql, s) == 1;
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            jlog.error("token "+token+" could not be added for user "+ 
-                    userid);
-            return false;
-        }
-    }
-
-
-    // returns the first token to find
-    public String getToken (String client_id, Integer userid) {
-        String sql = "select access_token from oauth2_access_token where user_id=:uid"
-                + " and status=1 and client_id=:cli limit 1;";
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("uid", userid);
-        s.addValue("cli", client_id);
-        try {
-            return this.jdbcTemplate.queryForObject(sql, s, String.class);
-        }
-        catch (EmptyResultDataAccessException ex) {
-            jlog.error("no token found for user "+ userid);
-            return null;
-        }
-        catch (DataAccessException ex) {
-            jlog.error("token retrieval failed for user "+ userid);
-            return null;
-        }
-    }
-
-
-    public List<ClientInfo> getAuthorizedClients (Integer userid) {
-        String sql = "select cl.* from oauth2_client as cl where cl.client_id in (select cd.client_id from oauth2_access_token as cd "
-                + "where cd.user_id=:user) or cl.is_confidential=:conf;";
-
-        //todo: test query
-        //        "select cl.* from oauth2_client as cl inner join oauth2_access_token as cd "
-        //                + "on cd.client_id=cl.client_id where cd.user_id=:user or cl.is_confidential=:conf;"
-
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("user", userid);
-        s.addValue("conf", BooleanUtils.getBoolean(true));
-        try {
-            // secret is not returned for this function
-            return this.jdbcTemplate.query(sql, s, new RowMapper<ClientInfo>() {
-
-                @Override
-                public ClientInfo mapRow (ResultSet rs, int rowNum)
-                        throws SQLException {
-                    ClientInfo info = new ClientInfo(rs.getString("client_id"), "*****");
-                    info.setConfidential(rs.getBoolean("is_confidential"));
-                    info.setUrl(rs.getString("url"));
-                    info.setId(rs.getInt("id"));
-                    info.setRedirect_uri(rs.getString("redirect_uri"));
-                    return info;
-                }
-            });
-        }
-        catch (DataAccessException e) {
-            jlog.error("Data access error", e);
-            return Collections.emptyList();
-        }
-
-    }
-
-
-    // todo: expired token must trigger an invalid token exception to trigger a refresh token
-    public TokenContext getContext (final String token)
-            throws KustvaktException {
-        String sql = "select ko.username, oa.expiration, oa.scopes from oauth2_access_token as oa inner join korap_users as ko "
-                + "on ko.id=oa.user_id where oa.access_token=:token and oa.expiration > :now;";
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("token", token);
-        s.addValue("now", new Timestamp(TimeUtils.getNow().getMillis()));
-
-        try {
-            TokenContext context = this.jdbcTemplate.queryForObject(sql, s,
-                    new RowMapper<TokenContext>() {
-                        @Override
-                        public TokenContext mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            long exp = rs.getTimestamp("expiration").getTime();
-                            TokenContext c = new TokenContext();
-                            c.setUsername(rs.getString(Attributes.USERNAME));
-                            c.setExpirationTime(exp);
-                            c.setToken(token);
-                            c.setTokenType(TokenType.BEARER);
-//                            c.setTokenType(Attributes.OAUTH2_AUTHORIZATION);
-                            c.addContextParameter(Attributes.SCOPE,
-                                    rs.getString(Attributes.SCOPE));
-                            return c;
-                        }
-                    });
-            return context;
-        }
-        catch (EmptyResultDataAccessException ee) {
-            jlog.error("no context found for token "+ token);
-            revokeToken(token);
-            throw new KustvaktException(StatusCodes.EXPIRED, "token", token);
-        }
-        catch (DataAccessException e) {
-            jlog.error("token context retrieval failed for "+ token);
-            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT,
-                    "invalid token", token);
-        }
-
-    }
-
-
-    // subsequently delete all access and auth code tokens associated!
-    public void removeClient (ClientInfo info, User user)
-            throws KustvaktException {
-        MapSqlParameterSource p = new MapSqlParameterSource();
-        p.addValue("url", info.getUrl());
-        p.addValue("cls", info.getClient_secret());
-        p.addValue("clid", info.getClient_id());
-        String sql = "delete from oauth2_client where client_id=:clid and client_secret=:cls and"
-                + " url=:url;";
-        try {
-            this.jdbcTemplate.update(sql, p);
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            jlog.error("removing client "+info.getClient_id()+" failed");
-            throw new DatabaseException(new KustvaktException(user.getId(),
-                    StatusCodes.ILLEGAL_ARGUMENT, "arguments given not valid",
-                    info.toJSON()), StatusCodes.CLIENT_DEREGISTRATION_FAILED,
-                    info.toJSON());
-
-        }
-    }
-
-
-    public void registerClient (ClientInfo info, User user)
-            throws KustvaktException {
-        MapSqlParameterSource p = new MapSqlParameterSource();
-        p.addValue("clid", info.getClient_id());
-        p.addValue("con", info.isConfidential());
-        p.addValue("cls", info.getClient_secret());
-        p.addValue("clt", info.getClient_type());
-        p.addValue("url", info.getUrl());
-        p.addValue("r_url", info.getRedirect_uri());
-        String sql = "insert into oauth2_client (client_id, client_secret, client_type, url, is_confidential, redirect_uri) "
-                + "VALUES (:clid, :cls, :clt, :url, :con, :r_url);";
-        try {
-            this.jdbcTemplate.update(sql, p);
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            jlog.error("registering client "+info.getClient_id()+" failed");
-            throw new DatabaseException(new KustvaktException(user.getId(),
-                    StatusCodes.ILLEGAL_ARGUMENT, "arguments given not valid",
-                    info.toJSON()), StatusCodes.CLIENT_REGISTRATION_FAILED,
-                    info.toJSON());
-        }
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
index 0d6004e..b550dae 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
@@ -22,6 +22,7 @@
  * @author hanl
  * @date 27/01/2016
  */
+@Deprecated
 public class UserDetailsDao implements UserDataDbIface<UserDetails> {
 
     private NamedParameterJdbcTemplate jdbcTemplate;
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
index ba2f927..55d19d9 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
@@ -25,6 +25,7 @@
  * @author hanl
  * @date 28/01/2016
  */
+@Deprecated
 public class UserSettingsDao implements UserDataDbIface<UserSettings> {
 
     private static final Logger jlog = LogManager
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index 0c14584..d67d911 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -247,13 +247,13 @@
 			ref="kustvakt_config" />
 	</bean>
 
-	<bean id="openid_auth"
+	<!-- <bean id="openid_auth"
 		class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
 		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
 			ref="kustvakt_config" />
 		<constructor-arg
 			type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
-	</bean>
+	</bean> -->
 
 	<bean id="session_auth"
 		class="de.ids_mannheim.korap.authentication.SessionAuthentication">
@@ -271,7 +271,7 @@
 		<ref bean="ldap_auth" />
 		<ref bean="session_auth" />
 		<!-- <ref bean="api_auth" /> -->
-		<ref bean="openid_auth" />
+		<!-- <ref bean="openid_auth" /> -->
 		<ref bean="oauth2_auth" />
 	</util:list>
 
diff --git a/full/src/main/resources/ehcache.xml b/full/src/main/resources/ehcache.xml
index 8cddd0e..27a4b56 100644
--- a/full/src/main/resources/ehcache.xml
+++ b/full/src/main/resources/ehcache.xml
@@ -34,8 +34,7 @@
            diskSpoolBufferSizeMB="30"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
-           statistics="false"/>
-           
+           />
            
     <!-- EM --> 
     <cache name='authorization'
diff --git a/full/src/main/resources/log4j2-debug.properties b/full/src/main/resources/log4j2-debug.properties
new file mode 100644
index 0000000..817e355
--- /dev/null
+++ b/full/src/main/resources/log4j2-debug.properties
@@ -0,0 +1,31 @@
+appenders = console, debugFile
+appender.console.type = Console
+appender.console.name = STDOUT
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
+
+appender.debugFile.type = File
+appender.debugFile.name = DEBUGLOG
+appender.debugFile.fileName=./logs/debug.log
+appender.debugFile.layout.type=PatternLayout
+appender.debugFile.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
+
+rootLogger.level = warn
+rootLogger.appenderRefs = debugFile
+rootLogger.appenderRef.file.ref = DEBUGLOG
+rootLogger.additivity=false
+
+loggers=file
+logger.file.name=de.ids_mannheim.korap
+logger.file.level = debug
+logger.file.appenderRefs = debugFile
+logger.file.appenderRef.file.ref = DEBUGLOG
+logger.file.additivity=false
+
+
+#loggers=file
+#logger.file.name=com.sun.jersey.test.framework.spi.container
+#logger.file.level = info
+#logger.file.appenderRefs = file
+#logger.file.appenderRef.file.ref = ERRORLOG
+#logger.file.additivity=false
\ No newline at end of file
diff --git a/full/src/main/resources/log4j2.properties b/full/src/main/resources/log4j2.properties
index b616418..1acd50c 100644
--- a/full/src/main/resources/log4j2.properties
+++ b/full/src/main/resources/log4j2.properties
@@ -1,29 +1,16 @@
-appenders = console, file
+appenders = console, mainFile
 appender.console.type = Console
 appender.console.name = STDOUT
 appender.console.layout.type = PatternLayout
 appender.console.layout.pattern = %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
 
-appender.file.type = File
-appender.file.name = ERRORLOG
-appender.file.fileName=./logs/errors.log
-appender.file.layout.type=PatternLayout
-appender.file.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
+appender.mainFile.type = File
+appender.mainFile.name = MAINLOG
+appender.mainFile.fileName=./logs/main.log
+appender.mainFile.layout.type=PatternLayout
+appender.mainFile.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
 
-rootLogger.level = error
-rootLogger.appenderRefs = stdout
-rootLogger.appenderRef.stdout.ref = STDOUT
-
-loggers=file
-logger.file.name=de.ids_mannheim.korap
-logger.file.level = error
-logger.file.appenderRefs = file
-logger.file.appenderRef.file.ref = ERRORLOG
-logger.file.additivity=true
-
-#loggers=file
-#logger.file.name=com.sun.jersey.test.framework.spi.container
-#logger.file.level = info
-#logger.file.appenderRefs = file
-#logger.file.appenderRef.file.ref = ERRORLOG
-#logger.file.additivity=false
\ No newline at end of file
+rootLogger.level = warn
+rootLogger.appenderRefs = mainFile
+rootLogger.appenderRef.file.ref = MAINLOG
+rootLogger.additivity=false
\ No newline at end of file
diff --git a/full/src/test/resources/test-config.xml b/full/src/test/resources/test-config.xml
index 945720b..7a4b439 100644
--- a/full/src/test/resources/test-config.xml
+++ b/full/src/test/resources/test-config.xml
@@ -233,13 +233,13 @@
 			ref="kustvakt_config" />
 	</bean>
 
-	<bean id="openid_auth"
+	<!-- <bean id="openid_auth"
 		class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
 		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
 			ref="kustvakt_config" />
 		<constructor-arg
 			type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
-	</bean>
+	</bean> -->
 
 	<bean id="basic_auth"
 		class="de.ids_mannheim.korap.authentication.BasicAuthentication" />
@@ -263,7 +263,7 @@
 		<ref bean="ldap_auth" />
 		<ref bean="session_auth" />
 		<!-- <ref bean="api_auth" /> -->
-		<ref bean="openid_auth" />
+		<!-- <ref bean="openid_auth" /> -->
 		<ref bean="oauth2_auth" />
 	</util:list>
 
