1- using IdentityServer4 . AccessTokenValidation ;
1+ using System ;
2+ using IdentityServer4 . AccessTokenValidation ;
23using Jp . Infra . CrossCutting . IoC ;
34using Jp . UserManagement . Configuration ;
45using MediatR ;
@@ -12,24 +13,24 @@ namespace Jp.UserManagement
1213 public class Startup
1314 {
1415 public IConfiguration Configuration { get ; }
15- public IHostingEnvironment Environment { get ; }
16+ public IHostingEnvironment HostEnvironment { get ; }
1617
17- public Startup ( IHostingEnvironment environment )
18+ public Startup ( IHostingEnvironment hostEnvironment )
1819 {
1920 var builder = new ConfigurationBuilder ( )
20- . SetBasePath ( environment . ContentRootPath )
21+ . SetBasePath ( hostEnvironment . ContentRootPath )
2122 . AddJsonFile ( "appsettings.json" , optional : true , reloadOnChange : true )
22- . AddJsonFile ( $ "appsettings.{ environment . EnvironmentName } .json", optional : true , reloadOnChange : true )
23+ . AddJsonFile ( $ "appsettings.{ hostEnvironment . EnvironmentName } .json", optional : true , reloadOnChange : true )
2324 . AddEnvironmentVariables ( ) ;
2425
25- if ( environment . IsDevelopment ( ) )
26+ if ( hostEnvironment . IsDevelopment ( ) )
2627 {
2728 builder . AddUserSecrets < Startup > ( ) ;
2829 }
2930
3031 builder . AddEnvironmentVariables ( ) ;
3132 Configuration = builder . Build ( ) ;
32- Environment = environment ;
33+ HostEnvironment = hostEnvironment ;
3334 }
3435 // This method gets called by the runtime. Use this method to add services to the container.
3536 // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
@@ -48,7 +49,7 @@ public void ConfigureServices(IServiceCollection services)
4849 } )
4950 . AddIdentityServerAuthentication ( options =>
5051 {
51- options . Authority = "http://localhost:5000" ;
52+ options . Authority = Environment . GetEnvironmentVariable ( "AUTHORITY" ) ?? "http://localhost:5000" ;
5253 options . RequireHttpsMetadata = false ;
5354 options . ApiSecret = "Q&tGrEQMypEk.XxPU:%bWDZMdpZeJiyMwpLv4F7d**w9x:7KuJ#fy,E8KPHpKz++" ;
5455 options . ApiName = "UserManagementApi" ;
@@ -76,6 +77,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
7677 else
7778 {
7879 app . UseHsts ( ) ;
80+ app . UseHttpsRedirection ( ) ;
7981 }
8082
8183 app . UseAuthentication ( ) ;
0 commit comments