Skip to content

Commit f761a36

Browse files
Ticket ## : Fix the build
1 parent 6ed9926 commit f761a36

File tree

25 files changed

+432
-113
lines changed

25 files changed

+432
-113
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,15 @@ For project documentation, please visit [readthedocs](https://simpleidserver.rea
2424

2525
## Contributing
2626

27-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
27+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
28+
29+
## Live demo
30+
31+
Live demo : [http://simpleidserver.northeurope.cloudapp.azure.com/simpleidserver](http://simpleidserver.northeurope.cloudapp.azure.com/simpleidserver/).
32+
33+
Administrator credentials :
34+
35+
| Property | Value |
36+
|---------------|-----------------|
37+
| login | administrator |
38+
| value | password |

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ deploy:
2525
api_key:
2626
secure: zs1JVjFHRdvB36fGq2rN8MR7QeJnCVkt7VTG4ZHT5OYDNpuh2AlGHqK+rseevn8l
2727
skip_symbols: true
28-
artifact: build\results\*.nupkg
28+
artifact: /.*\.nupkg/
2929
on:
3030
branch: master
3131
- provider: NuGet
3232
name: production
33-
artifact: build\results\*.nupkg
33+
artifact: /.*\.nupkg/
3434
api_key:
3535
secure: Uigh51VjtY/sVniNFhkSvZ60/FvI9DyJ/g2feCm/WNdzeN9x5FSiqQwF9Y8qQ6nj
3636
on:

conf/openid.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Description=OPENID server
33
After=network.target
44

55
[Service]
6-
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/OpenID/SimpleIdServer.OpenID.Startup.dll --server.urls="http://*:60000"
6+
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/OpenID/SimpleIdServer.OpenID.Startup.dll --pathBase=/openid --server.urls="http://*:60000"
77
KillMode=process
88
TimeoutStopSec=5s
99
Restart=always
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Description=SimpleIdServer API
33
After=network.target
44

55
[Service]
6-
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/SimpleIdServerApi/SimpleIdServer.Gateway.Host.dll --server.urls="http://*:70001"
6+
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/SimpleIdServerApi/SimpleIdServer.Gateway.Host.dll --server.urls="http://*:5001"
77
KillMode=process
88
TimeoutStopSec=5s
99
Restart=always
1010
WorkingDirectory=/home/ftpuser/src/build/results/services/SimpleIdServerApi
11+
Environment=ASPNETCORE_ENVIRONMENT=Production
1112

1213
[Install]
1314
WantedBy=multi-user.target

conf/sidwebsite.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Description=SimpleIdServer website
33
After=network.target
44

55
[Service]
6-
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/SimpleIdServerWebsite/SimpleIdServer.Website.dll --pathBase=/simpleidserver --server.urls="http://*:70000"
6+
ExecStart=/usr/bin/dotnet /home/ftpuser/src/build/results/services/SimpleIdServerWebsite/SimpleIdServer.Website.dll --pathBase=/simpleidserver --server.urls="http://*:5000"
77
KillMode=process
88
TimeoutStopSec=5s
99
Restart=always

conf/simpleidserver.nginx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ server {
1313
server_name simpleidserver.northeurope.cloudapp.azure.com;
1414

1515
location /simpleidserver {
16-
proxy_pass http://localhost:70000;
16+
proxy_pass http://localhost:5000;
1717
proxy_set_header Upgrade $http_upgrade;
1818
proxy_set_header Connection keep-alive;
1919
proxy_set_header Host $host;
@@ -36,7 +36,7 @@ server {
3636
}
3737

3838
location /simpleidserverapi {
39-
proxy_pass http://localhost:70001;
39+
proxy_pass http://localhost:5001/simpleidserverapi;
4040
proxy_set_header Upgrade $http_upgrade;
4141
proxy_set_header Connection keep-alive;
4242
proxy_set_header Host $host;

src/OpenID/SimpleIdServer.OpenID.Startup/DefaultConfiguration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ public class DefaultConfiguration
255255
},
256256
RedirectionUrls = new List<string>
257257
{
258-
"http://localhost:4200"
258+
"http://localhost:4200",
259+
"http://simpleidserver.northeurope.cloudapp.azure.com/simpleidserver"
259260
},
260261
PreferredTokenProfile = "Bearer",
261262
ResponseTypes = new List<string>

src/OpenID/SimpleIdServer.OpenID.Startup/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"SimpleIdServer.OpenID.Startup": {
44
"commandName": "Project",
55
"launchBrowser": true,
6-
"applicationUrl": "https://localhost:60000",
6+
"applicationUrl": "http://localhost:60000",
77
"environmentVariables": {
88
"ASPNETCORE_ENVIRONMENT": "Development"
99
}

src/OpenID/SimpleIdServer.OpenID.Startup/Startup.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@
33
using Microsoft.AspNetCore.Authentication.Cookies;
44
using Microsoft.AspNetCore.Builder;
55
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.AspNetCore.HttpOverrides;
7+
using Microsoft.Extensions.Configuration;
68
using Microsoft.Extensions.DependencyInjection;
79
using Microsoft.Extensions.Logging;
810
using Newtonsoft.Json;
911
using SimpleIdServer.Jwt;
1012
using SimpleIdServer.Jwt.Extensions;
1113
using System.Collections.Generic;
1214
using System.IO;
15+
using System.Linq;
1316
using System.Security.Cryptography;
1417

1518
namespace SimpleIdServer.OpenID.Startup
1619
{
1720
public class Startup
1821
{
19-
public Startup(IHostingEnvironment env) { }
22+
private readonly IHostingEnvironment _env;
23+
private readonly IConfiguration _configuration;
24+
25+
public Startup(IHostingEnvironment env, IConfiguration configuration)
26+
{
27+
_env = env;
28+
_configuration = configuration;
29+
}
2030

2131
public void ConfigureServices(IServiceCollection services)
2232
{
@@ -46,10 +56,20 @@ public void ConfigureServices(IServiceCollection services)
4656
.AddScopes(DefaultConfiguration.Scopes)
4757
.AddJsonWebKeys(new List<JsonWebKey> { sigJsonWebKey })
4858
.AddLoginPasswordAuthentication();
59+
services.Configure<ForwardedHeadersOptions>(options =>
60+
{
61+
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
62+
});
4963
}
5064

5165
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
5266
{
67+
if (_configuration.GetChildren().Any(i => i.Key == "pathBase"))
68+
{
69+
app.UsePathBase(_configuration["pathBase"]);
70+
}
71+
72+
app.UseForwardedHeaders();
5373
app.UseCors("AllowAll");
5474
app.UseAuthentication();
5575
app.UseStaticFiles();

src/Website/SimpleIdServer.Gateway.Host/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public static void Main(string[] args)
1717
{
1818
config.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
1919
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
20-
.AddJsonFile("ocelot.json");
20+
.AddJsonFile($"ocelot.{hostingContext.HostingEnvironment.EnvironmentName}.json");
2121
})
22-
.UseUrls("http://*:60004")
22+
.UseUrls("http://*:5001")
2323
.UseStartup<Startup>()
2424
.Build();
2525
host.Run();

0 commit comments

Comments
 (0)