Merge branch 'features/IdSrvTimeoutReview' into dev

This commit is contained in:
unaizorrilla 2018-09-11 19:52:33 +02:00
commit 09d7d09248
3 changed files with 30 additions and 25 deletions

View File

@ -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"
} }
} }
}; };
} }
} }

View File

@ -80,7 +80,11 @@ 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 =>
{
x.IssuerUri = "null";
x.Authentication.CookieLifetime = TimeSpan.FromHours(2);
})
.AddSigningCredential(Certificate.Get()) .AddSigningCredential(Certificate.Get())
.AddAspNetIdentity<ApplicationUser>() .AddAspNetIdentity<ApplicationUser>()
.AddConfigurationStore(options => .AddConfigurationStore(options =>

View File

@ -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;