Merge branch 'features/IdSrvTimeoutReview' into dev
This commit is contained in:
commit
09d7d09248
@ -58,7 +58,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
|
|||||||
"marketing",
|
"marketing",
|
||||||
"webshoppingagg",
|
"webshoppingagg",
|
||||||
"orders.signalrhub"
|
"orders.signalrhub"
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
new Client
|
new Client
|
||||||
{
|
{
|
||||||
@ -124,6 +124,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
|
|||||||
"webshoppingagg",
|
"webshoppingagg",
|
||||||
"orders.signalrhub"
|
"orders.signalrhub"
|
||||||
},
|
},
|
||||||
|
AccessTokenLifetime = 60*60*2, // 2 hours
|
||||||
|
IdentityTokenLifetime= 60*60*2 // 2 hours
|
||||||
},
|
},
|
||||||
new Client
|
new Client
|
||||||
{
|
{
|
||||||
@ -248,7 +250,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
|
|||||||
"webshoppingagg"
|
"webshoppingagg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,30 +80,34 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
|||||||
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
|
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
|
||||||
|
|
||||||
// Adds IdentityServer
|
// Adds IdentityServer
|
||||||
services.AddIdentityServer(x => x.IssuerUri = "null")
|
services.AddIdentityServer(x =>
|
||||||
.AddSigningCredential(Certificate.Get())
|
{
|
||||||
.AddAspNetIdentity<ApplicationUser>()
|
x.IssuerUri = "null";
|
||||||
.AddConfigurationStore(options =>
|
x.Authentication.CookieLifetime = TimeSpan.FromHours(2);
|
||||||
|
})
|
||||||
|
.AddSigningCredential(Certificate.Get())
|
||||||
|
.AddAspNetIdentity<ApplicationUser>()
|
||||||
|
.AddConfigurationStore(options =>
|
||||||
|
{
|
||||||
|
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
|
||||||
|
sqlServerOptionsAction: sqlOptions =>
|
||||||
|
{
|
||||||
|
sqlOptions.MigrationsAssembly(migrationsAssembly);
|
||||||
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
||||||
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AddOperationalStore(options =>
|
||||||
{
|
{
|
||||||
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
|
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
|
||||||
sqlServerOptionsAction: sqlOptions =>
|
sqlServerOptionsAction: sqlOptions =>
|
||||||
{
|
{
|
||||||
sqlOptions.MigrationsAssembly(migrationsAssembly);
|
sqlOptions.MigrationsAssembly(migrationsAssembly);
|
||||||
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
||||||
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
|
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.AddOperationalStore(options =>
|
.Services.AddTransient<IProfileService, ProfileService>();
|
||||||
{
|
|
||||||
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
|
|
||||||
sqlServerOptionsAction: sqlOptions =>
|
|
||||||
{
|
|
||||||
sqlOptions.MigrationsAssembly(migrationsAssembly);
|
|
||||||
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
|
||||||
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.Services.AddTransient<IProfileService, ProfileService>();
|
|
||||||
|
|
||||||
var container = new ContainerBuilder();
|
var container = new ContainerBuilder();
|
||||||
container.Populate(services);
|
container.Populate(services);
|
||||||
|
@ -238,7 +238,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||||
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
|
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
|
||||||
})
|
})
|
||||||
.AddCookie()
|
.AddCookie(setup=>setup.ExpireTimeSpan = TimeSpan.FromHours(2))
|
||||||
.AddOpenIdConnect(options =>
|
.AddOpenIdConnect(options =>
|
||||||
{
|
{
|
||||||
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||||
@ -257,7 +257,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
options.Scope.Add("marketing");
|
options.Scope.Add("marketing");
|
||||||
options.Scope.Add("locations");
|
options.Scope.Add("locations");
|
||||||
options.Scope.Add("webshoppingagg");
|
options.Scope.Add("webshoppingagg");
|
||||||
options.Scope.Add("orders.signalrhub");
|
options.Scope.Add("orders.signalrhub");
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user