Use Services.Common in WebhookClient
This commit is contained in:
parent
6f4ae509f1
commit
e4b94decb2
@ -35,9 +35,7 @@ internal static class Extensions
|
||||
|
||||
public static IServiceCollection AddHttpClientServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
services.AddTransient<HttpClientAuthorizationDelegatingHandler>();
|
||||
services.AddHttpClient("extendedhandlerlifetime").SetHandlerLifetime(Timeout.InfiniteTimeSpan);
|
||||
|
||||
//add http client services
|
||||
services.AddHttpClient("GrantClient")
|
||||
|
@ -3,7 +3,6 @@ global using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
global using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using System.Security.Claims;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
@ -17,7 +16,7 @@ global using System.Text.Json;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using System.Net.Http.Headers;
|
||||
global using System.Threading;
|
||||
global using Microsoft.AspNetCore;
|
||||
global using Services.Common;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using WebhookClient;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
|
@ -1,5 +1,6 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.AddServiceDefaults();
|
||||
builder.Services.AddSession(opt =>
|
||||
{
|
||||
opt.Cookie.Name = ".eShopWebhooks.Session";
|
||||
@ -12,18 +13,7 @@ builder.Services.AddSession(opt =>
|
||||
.AddMvc();
|
||||
builder.Services.AddControllers();
|
||||
var app = builder.Build();
|
||||
|
||||
var pathBase = app.Configuration["PATH_BASE"];
|
||||
if (!string.IsNullOrEmpty(pathBase))
|
||||
{
|
||||
app.UsePathBase(pathBase);
|
||||
}
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
}
|
||||
app.UseServiceDefaults();
|
||||
|
||||
app.Map("/check", capp =>
|
||||
{
|
||||
@ -62,7 +52,6 @@ app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = SameSiteMo
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseSession();
|
||||
app.UseRouting();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.MapDefaultControllerRoute();
|
||||
|
@ -17,4 +17,8 @@
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Services\Services.Common\Services.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user