You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.eShopOnContainers.Services.Marketing.API;
  3. using Microsoft.Extensions.Configuration;
  4. namespace Marketing.FunctionalTests.Base
  5. {
  6. public class LocationsTestsStartup : Startup
  7. {
  8. public LocationsTestsStartup(IConfiguration configuration) : base(configuration)
  9. {
  10. }
  11. protected override void ConfigureAuth(IApplicationBuilder app)
  12. {
  13. if (Configuration["isTest"] == bool.TrueString.ToLowerInvariant())
  14. {
  15. app.UseMiddleware<AutoAuthorizeMiddleware>();
  16. }
  17. else
  18. {
  19. base.ConfigureAuth(app);
  20. }
  21. }
  22. //class LocationAuthorizeMiddleware
  23. //{
  24. // private readonly RequestDelegate _next;
  25. // public LocationAuthorizeMiddleware(RequestDelegate rd)
  26. // {
  27. // _next = rd;
  28. // }
  29. // public async Task Invoke(HttpContext httpContext)
  30. // {
  31. // var identity = new ClaimsIdentity("cookies");
  32. // identity.AddClaim(new Claim("sub", "4611ce3f-380d-4db5-8d76-87a8689058ed"));
  33. // httpContext.User.AddIdentity(identity);
  34. // await _next.Invoke(httpContext);
  35. // }
  36. //}
  37. }
  38. }