public static User Authenticate(this IDatabase database, string username, string password) { // Create a temporary connection for authentication only... using (var session = database.CreateSystemSession()) { session.CurrentSchema(SystemSchema.Name); session.ExclusiveLock(); using (var queryContext = new SessionQueryContext(session)) { return queryContext.Authenticate(username, password); } } }