Skip to content

Commit b97e486

Browse files
committed
Add CookieAuthentication and modify project properties
1 parent f66ab73 commit b97e486

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/AbpCompanyName.AbpProjectName.Web.Mvc.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
5-
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
6-
<PreserveCompilationContext>true</PreserveCompilationContext>
74
<AssemblyName>AbpCompanyName.AbpProjectName.Web.Mvc</AssemblyName>
85
<OutputType>Exe</OutputType>
96
<PackageId>AbpCompanyName.AbpProjectName.Web.Mvc</PackageId>
107
<UserSecretsId>AbpCompanyName-AbpProjectName-56C2EF2F-ABD6-4EFC-AAF2-2E81C34E8FB1</UserSecretsId>
118
<RootNamespace>AbpCompanyName.AbpProjectName.Web</RootNamespace>
9+
<TargetFramework>netcoreapp3.0</TargetFramework>
10+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
11+
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
12+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
13+
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
14+
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
15+
<PreserveCompilationContext>true</PreserveCompilationContext>
16+
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
17+
<PreserveCompilationReferences>true</PreserveCompilationReferences>
1218
</PropertyGroup>
1319

1420
<ItemGroup>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Startup/Startup.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Abp.AspNetCore.SignalR.Hubs;
1717
using Abp.Dependency;
1818
using Abp.Json;
19+
using Microsoft.AspNetCore.Authentication.Cookies;
1920
using Newtonsoft.Json.Serialization;
2021

2122

@@ -47,6 +48,9 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
4748
};
4849
});
4950

51+
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
52+
.AddCookie();
53+
5054
IdentityRegistrar.Register(services);
5155
AuthConfigurer.Configure(services, _appConfiguration);
5256

@@ -81,12 +85,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
8185
app.UseRouting();
8286

8387
app.UseAuthentication();
84-
8588
app.UseAuthorization();
8689

8790
app.UseJwtTokenMiddleware();
8891

89-
9092
app.UseEndpoints(endpoints =>
9193
{
9294
endpoints.MapHub<AbpCommonHub>("/signalr");

0 commit comments

Comments
 (0)