Added credentials lookup from database (for server) and config file (for apps)