builder.Services.AddTransient();
builder.Services.AddOidcAuthentication(options =>
{
options.ProviderOptions.Authority = "https://example.com";
options.ProviderOptions.ClientId = "your-client-id";
options.ProviderOptions.RedirectUri = "https://localhost:5001/authentication/login-callback";
});
这将为应用程序配置OpenID Connect身份验证,并且将找到AuthenticationService.init。