-
| Hi, I was hoping if you could please offer some tips on integration testing authenticated routes for our project using BFF I'm just looking for an MvP where we are able to generate a valid token using a test instance of Identity Server and then make some requests to authenticated BFF routes I've been looking at https://github.com/DuendeSoftware/products/blob/main/bff/test/Bff.Tests/TestInfra/IdentityServerTestHost.cs and trying to understand the core aspects of how Duende is able to login during tests Please could you confirm if I've got the correct understanding of how this works? 
 Many many thanks Ben | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
| Hi @bamarch, that seems like a proper analysis indeed. Note this code is not immediately intended to fit all scenarios you may have, but can probably serve as a good base for your solution. I also recently discovered https://github.com/alsami/alsami.Duende.IdentityServer.AspNetCore.Testing/blob/main/docs/IdentityServerTestWebHostBuilder.md which is a library that can also set up a test IdentityServer host. May be worth looking into as well. | 
Beta Was this translation helpful? Give feedback.
Hi @bamarch, that seems like a proper analysis indeed. Note this code is not immediately intended to fit all scenarios you may have, but can probably serve as a good base for your solution.
I also recently discovered https://github.com/alsami/alsami.Duende.IdentityServer.AspNetCore.Testing/blob/main/docs/IdentityServerTestWebHostBuilder.md which is a library that can also set up a test IdentityServer host. May be worth looking into as well.