Browse Source

Update Mvc.Client to ensure authentication cookies expire before access tokens

pull/1277/head
Kévin Chalet 5 years ago
parent
commit
e9173f6e7f
  1. 4
      samples/Mvc.Client/Startup.cs
  2. 2
      samples/Mvc.Client/Views/Shared/_Layout.cshtml

4
samples/Mvc.Client/Startup.cs

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
@ -21,6 +21,8 @@ namespace Mvc.Client
.AddCookie(options =>
{
options.LoginPath = "/login";
options.ExpireTimeSpan = TimeSpan.FromMinutes(50);
options.SlidingExpiration = false;
})
.AddOpenIdConnect(options =>

2
samples/Mvc.Client/Views/Shared/_Layout.cshtml

@ -7,7 +7,7 @@
<meta name="description" content="" />
<meta name="author" content="" />
<title>Mvc.Client (OSOS sample)</title>
<title>Mvc.Client</title>
<link href="~/stylesheets/bootstrap.min.css" rel="stylesheet" />
<link href="~/stylesheets/jumbotron-narrow.css" rel="stylesheet" />

Loading…
Cancel
Save