Browse Source

Put UseAbpRequestLocalization just after the UseAuthentication

pull/3932/head
liangshiwei 6 years ago
parent
commit
e97f07b011
  1. 4
      samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs
  2. 4
      samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs
  3. 4
      samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs
  4. 7
      samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs
  5. 4
      samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs
  6. 4
      samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs
  7. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  8. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
  9. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  10. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs
  11. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
  12. 6
      templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs
  13. 8
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  14. 8
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  15. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs
  16. 3
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs

4
samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -118,8 +118,8 @@ namespace BackendAdminApp.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();

4
samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -96,8 +96,8 @@ namespace PublicWebSite.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();

4
samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -120,7 +120,6 @@ namespace BloggingService.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization(); //TODO: localization?
app.UseAuthentication();
app.Use(async (ctx, next) =>
@ -137,6 +136,7 @@ namespace BloggingService.Host
currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer))));
await next();
});
app.UseAbpRequestLocalization(); //TODO: localization?
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();

7
samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Builder;
@ -101,12 +101,14 @@ namespace IdentityService.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization(); //TODO: localization?
app.UseAuthentication();
app.UseAbpRequestLocalization(); //TODO: localization?
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();
}
app.Use(async (ctx, next) =>
{
var currentPrincipalAccessor = ctx.RequestServices.GetRequiredService<ICurrentPrincipalAccessor>();
@ -121,7 +123,6 @@ namespace IdentityService.Host
currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer))));
await next();
});
app.UseSwagger();
app.UseSwaggerUI(options =>
{

4
samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Builder;
@ -104,7 +104,6 @@ namespace ProductService.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization(); //TODO: localization?
app.UseAuthentication();
app.Use(async (ctx, next) =>
@ -121,6 +120,7 @@ namespace ProductService.Host
currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer))));
await next();
});
app.UseAbpRequestLocalization(); //TODO: localization?
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();

4
samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Builder;
@ -105,7 +105,6 @@ namespace TenantManagementService.Host
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization(); //TODO: localization?
app.UseAuthentication();
app.Use(async (ctx, next) =>
@ -122,6 +121,7 @@ namespace TenantManagementService.Host
currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer))));
await next();
});
app.UseAbpRequestLocalization(); //TODO: localization?
if (MsDemoConsts.IsMultiTenancyEnabled)
{
app.UseMultiTenancy();

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Builder;
@ -178,8 +178,8 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
@ -168,10 +168,10 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using Localization.Resources.AbpUi;
@ -154,12 +154,14 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseIdentityServer();
app.UseAuthorization();
app.UseAuditing();

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using Microsoft.AspNetCore.Builder;
@ -225,8 +225,8 @@ namespace MyCompanyName.MyProjectName.Web
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore;
@ -204,9 +204,9 @@ namespace MyCompanyName.MyProjectName.Web
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{

6
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using Localization.Resources.AbpUi;
@ -88,9 +88,9 @@ namespace MyCompanyName.MyProjectName
});
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseRouting();
app.UseAuthentication();
app.UseAbpRequestLocalization();
app.UseAuthorization();

8
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using IdentityModel;
@ -164,13 +164,15 @@ namespace MyCompanyName.MyProjectName
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAbpRequestLocalization();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>

8
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
@ -185,14 +185,16 @@ namespace MyCompanyName.MyProjectName
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAbpRequestLocalization();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseIdentityServer();
app.UseAuthorization();
app.UseSwagger();

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs

@ -234,8 +234,8 @@ namespace MyCompanyName.MyProjectName
app.UseHttpsRedirection();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
if (MultiTenancyConsts.IsEnabled)
{

3
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs

@ -127,9 +127,10 @@ namespace MyCompanyName.MyProjectName
app.UseHttpsRedirection();
app.UseVirtualFiles();
app.UseRouting();
app.UseAbpRequestLocalization();
app.UseAuthentication();
app.UseAbpRequestLocalization();
app.UseAuthorization();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();

Loading…
Cancel
Save