|
|
@ -4,12 +4,13 @@ |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.eShopOnContainers.Services.Locations.API; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using System.Security.Claims; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
public class LocationsTestsStartup : Startup |
|
|
|
{ |
|
|
|
public LocationsTestsStartup(IHostingEnvironment env) : base(env) |
|
|
|
public LocationsTestsStartup(IConfiguration configuration) : base(configuration) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
@ -28,6 +29,7 @@ |
|
|
|
class LocationAuthorizeMiddleware |
|
|
|
{ |
|
|
|
private readonly RequestDelegate _next; |
|
|
|
|
|
|
|
public LocationAuthorizeMiddleware(RequestDelegate rd) |
|
|
|
{ |
|
|
|
_next = rd; |
|
|
@ -38,6 +40,7 @@ |
|
|
|
var identity = new ClaimsIdentity("cookies"); |
|
|
|
identity.AddClaim(new Claim("sub", "4611ce3f-380d-4db5-8d76-87a8689058ed")); |
|
|
|
httpContext.User.AddIdentity(identity); |
|
|
|
|
|
|
|
await _next.Invoke(httpContext); |
|
|
|
} |
|
|
|
} |
|
|
|