Unable to integration test with web api use Openiddict

Viewed 125

MS Docs mock-authentication

Please take a look at above link. If I use below code,will throw exception said duplicate scheme.

var scheme="OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme";

services.AddAuthentication(scheme)
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
scheme, options => {});

So I don't know how to add the mock handler to the scheme which was added by openiddict or remove the openiddict service when running the test.

0 Answers
Related