using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.DependencyInjection; namespace Admin.NET.Plugin.AiDOP.DataPlatform.UnifiedIngress; public static class MdpIngestServiceCollectionExtensions { public static IServiceCollection AddMdpUnifiedIngress(this IServiceCollection services) { services.AddTransient(); services.AddSingleton(); services.AddSingleton(); services.AddScoped(); services.AddScoped(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddScoped(); services.AddSingleton(); services.AddHttpClient(MdpIngestExternalIdentities.MetadataClient, client => client.Timeout = TimeSpan.FromSeconds(8)) .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false }); services.AddScoped(); services.AddSingleton(); services.AddAuthentication().AddScheme( MdpIngestProtocol.AuthenticationScheme, _ => { }); return services; } }