I suggest that you read up on Dependency Injection in ASP.NET Core: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0
This should provide you with a good overview of how to work with getting services, of which the Couchbase SDK is just one example of many. It’s really the underpinning of any ASP.NET Core web application, and you’ll need a good understanding of it to move forward with your application, regardless of whether you use Couchbase or not.
However, I can help some with this particular case. I recommend adding the following line to ConfigureServices to register your Authentication service with the DI system:
Then, instead of making a new instance yourself, get it from the DI container when you need it.
app.Use(async (context, next) =>
var authentication = context.RequestServices.GetRequiredService<Functions.Authentication>();
There are also a lot of other, cleaner ways to implement this. Such as a Middleware class that has your implementation, and which accepts Authentication on its constructor: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/write?view=aspnetcore-5.0