Browse Source
Merge pull request #1163 from abpframework/maliming/https
resolve #1157 Configure HTTPS for all applications.
pull/1170/head
Halil İbrahim Kalkan
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with
38 additions and
24 deletions
-
templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
-
templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/Properties/launchSettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
-
templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/Properties/launchSettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/appsettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/Properties/launchSettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/appsettings.json
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs
-
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/Properties/launchSettings.json
-
templates/mvc-module/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/appsettings.json
|
|
|
@ -102,7 +102,12 @@ namespace MyCompanyName.MyProjectName |
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
var app = context.GetApplicationBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
if (!context.GetEnvironment().IsDevelopment()) |
|
|
|
{ |
|
|
|
app.UseHsts(); |
|
|
|
} |
|
|
|
app.UseHttpsRedirection(); |
|
|
|
app.UseCorrelationId(); |
|
|
|
app.UseVirtualFiles(); |
|
|
|
app.UseAuthentication(); |
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
"anonymousAuthentication": true, |
|
|
|
"iisExpress": { |
|
|
|
"applicationUrl": "http://localhost:57992", |
|
|
|
"sslPort": 0 |
|
|
|
"sslPort": 44300 //44300 to 44399 (inclusive) |
|
|
|
} |
|
|
|
}, |
|
|
|
"profiles": { |
|
|
|
@ -18,7 +18,7 @@ |
|
|
|
"MyCompanyName.MyProjectName.DemoApp": { |
|
|
|
"commandName": "Project", |
|
|
|
"launchBrowser": true, |
|
|
|
"applicationUrl": "http://localhost:5000", |
|
|
|
"applicationUrl": "https://localhost:5001;http://localhost:5000", |
|
|
|
"environmentVariables": { |
|
|
|
"ASPNETCORE_ENVIRONMENT": "Development" |
|
|
|
} |
|
|
|
|
|
|
|
@ -7,6 +7,6 @@ |
|
|
|
"Configuration": "127.0.0.1" |
|
|
|
}, |
|
|
|
"AuthServer": { |
|
|
|
"Authority": "http://localhost:61517" |
|
|
|
"Authority": "https://localhost:44301/" |
|
|
|
} |
|
|
|
} |
|
|
|
@ -121,7 +121,12 @@ namespace MyCompanyName.MyProjectName |
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
var app = context.GetApplicationBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
if (!context.GetEnvironment().IsDevelopment()) |
|
|
|
{ |
|
|
|
app.UseHsts(); |
|
|
|
} |
|
|
|
app.UseHttpsRedirection(); |
|
|
|
app.UseCorrelationId(); |
|
|
|
app.UseVirtualFiles(); |
|
|
|
app.UseAuthentication(); |
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
{ |
|
|
|
"iisSettings": { |
|
|
|
"windowsAuthentication": false, |
|
|
|
"anonymousAuthentication": true, |
|
|
|
"anonymousAuthentication": true, |
|
|
|
"iisExpress": { |
|
|
|
"applicationUrl": "http://localhost:61517", |
|
|
|
"sslPort": 0 |
|
|
|
"sslPort": 44301 //44300 to 44399 (inclusive) |
|
|
|
} |
|
|
|
}, |
|
|
|
"profiles": { |
|
|
|
@ -18,7 +18,7 @@ |
|
|
|
"IdentityServerHost": { |
|
|
|
"commandName": "Project", |
|
|
|
"launchBrowser": true, |
|
|
|
"applicationUrl": "http://localhost:5000", |
|
|
|
"applicationUrl": "https://localhost:5001;http://localhost:5000", |
|
|
|
"environmentVariables": { |
|
|
|
"ASPNETCORE_ENVIRONMENT": "Development" |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
{ |
|
|
|
"AppSelfUrl": "http://localhost:61517/", |
|
|
|
"AppSelfUrl": "https://localhost:44301/", |
|
|
|
"ConnectionStrings": { |
|
|
|
"Default": "Server=localhost;Database=MyProjectName_Main;Trusted_Connection=True;MultipleActiveResultSets=true" |
|
|
|
}, |
|
|
|
@ -7,14 +7,14 @@ |
|
|
|
"Configuration": "127.0.0.1" |
|
|
|
}, |
|
|
|
"AuthServer": { |
|
|
|
"Authority": "http://localhost:61517/", |
|
|
|
"Authority": "https://localhost:44301/", |
|
|
|
"ApiName": "MyProjectName" |
|
|
|
}, |
|
|
|
"IdentityServer": { |
|
|
|
"Clients": { |
|
|
|
"MyProjectName_Web": { |
|
|
|
"ClientId": "MyProjectName_Web", |
|
|
|
"RootUrl": "https://localhost:44314/" |
|
|
|
"RootUrl": "https://localhost:44302/" |
|
|
|
}, |
|
|
|
"MyProjectName_ConsoleTestApp": { |
|
|
|
"ClientId": "MyProjectName_ConsoleTestApp" |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
@ -207,8 +207,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
else |
|
|
|
{ |
|
|
|
app.UseErrorPage(); |
|
|
|
app.UseHsts(); |
|
|
|
} |
|
|
|
|
|
|
|
app.UseHttpsRedirection(); |
|
|
|
app.UseVirtualFiles(); |
|
|
|
app.UseAuthentication(); |
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ |
|
|
|
@if (!CurrentUser.IsAuthenticated) |
|
|
|
{ |
|
|
|
<form method="POST"> |
|
|
|
<input type="submit" asp-page-handler="Login" value="LOGIN" class="btn btn-login" /> |
|
|
|
<input type="submit" asp-page-handler="Login" value="LOGIN" class="btn btn-primary" /> |
|
|
|
</form> |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
"anonymousAuthentication": true, |
|
|
|
"iisExpress": { |
|
|
|
"applicationUrl": "http://localhost:55953", |
|
|
|
"sslPort": 44314 |
|
|
|
"sslPort": 44302 //44300 to 44399 (inclusive) |
|
|
|
} |
|
|
|
}, |
|
|
|
"profiles": { |
|
|
|
|
|
|
|
@ -1,18 +1,18 @@ |
|
|
|
{ |
|
|
|
"AppSelfUrl": "https://localhost:44314/", |
|
|
|
"AppSelfUrl": "https://localhost:44302/", |
|
|
|
"RemoteServices": { |
|
|
|
"Default": { |
|
|
|
"BaseUrl": "http://localhost:61517/" |
|
|
|
"BaseUrl": "https://localhost:44301/" |
|
|
|
}, |
|
|
|
"MyProjectName": { |
|
|
|
"BaseUrl": "http://localhost:57992/" |
|
|
|
"BaseUrl": "https://localhost:44300/" |
|
|
|
} |
|
|
|
}, |
|
|
|
"Redis": { |
|
|
|
"Configuration": "127.0.0.1" |
|
|
|
}, |
|
|
|
"AuthServer": { |
|
|
|
"Authority": "http://localhost:61517/", |
|
|
|
"Authority": "https://localhost:44301/", |
|
|
|
"ClientId": "MyProjectName_Web", |
|
|
|
"ClientSecret": "1q2w3e*" |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
@ -109,8 +109,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
else |
|
|
|
{ |
|
|
|
app.UseErrorPage(); |
|
|
|
app.UseHsts(); |
|
|
|
} |
|
|
|
|
|
|
|
app.UseHttpsRedirection(); |
|
|
|
app.UseVirtualFiles(); |
|
|
|
|
|
|
|
app.UseSwagger(); |
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
"anonymousAuthentication": true, |
|
|
|
"iisExpress": { |
|
|
|
"applicationUrl": "http://localhost:57891", |
|
|
|
"sslPort": 0 |
|
|
|
"sslPort": 44303 //44300 to 44399 (inclusive) |
|
|
|
} |
|
|
|
}, |
|
|
|
"profiles": { |
|
|
|
@ -18,7 +18,7 @@ |
|
|
|
"MyCompanyName.MyProjectName.DemoApp": { |
|
|
|
"commandName": "Project", |
|
|
|
"launchBrowser": true, |
|
|
|
"applicationUrl": "http://localhost:5000", |
|
|
|
"applicationUrl": "https://localhost:5001;http://localhost:5000", |
|
|
|
"environmentVariables": { |
|
|
|
"ASPNETCORE_ENVIRONMENT": "Development" |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
{ |
|
|
|
"RemoteServices": { |
|
|
|
"Default": { |
|
|
|
"BaseUrl": "http://localhost:61517/" |
|
|
|
"BaseUrl": "https://localhost:44301/" |
|
|
|
}, |
|
|
|
"MyProjectName": { |
|
|
|
"BaseUrl": "http://localhost:57992/" |
|
|
|
"BaseUrl": "https://localhost:44300/" |
|
|
|
} |
|
|
|
}, |
|
|
|
"IdentityClients": { |
|
|
|
@ -14,7 +14,7 @@ |
|
|
|
"ClientSecret": "1q2w3e*", |
|
|
|
"UserName": "admin", |
|
|
|
"UserPassword": "1q2w3E*", |
|
|
|
"Authority": "http://localhost:61517", |
|
|
|
"Authority": "https://localhost:44301/", |
|
|
|
"Scope": "MyProjectName" |
|
|
|
} |
|
|
|
} |
|
|
|
|