From 364036b9e478d1db1c10d41d248e8cfd842c5a0b Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 25 Oct 2024 12:23:34 +0200 Subject: [PATCH] feat(API): Authentifizierungs-Cookie aktualisiert. - ExpireTimeSpan als 1 Stunde zugewiesen. - SlidingExpiration als wahre Stunde zugewiesen. - Cookie-Name als 'AuthSession' zugewiesen. --- WorkFlow.API/Program.cs | 3 +++ WorkFlow.API/appsettings.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WorkFlow.API/Program.cs b/WorkFlow.API/Program.cs index 09f5062..951cde6 100644 --- a/WorkFlow.API/Program.cs +++ b/WorkFlow.API/Program.cs @@ -27,6 +27,9 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc options.Cookie.SameSite = SameSiteMode.Strict; // Protects against CSRF attacks by restricting how cookies are sent with requests from external sites options.LoginPath = "/api/auth/login"; options.LogoutPath = "/api/auth/logout"; + options.ExpireTimeSpan = TimeSpan.FromMinutes(60); // timeout. + options.SlidingExpiration = true; //refreshes the expiration time on each request. + options.Cookie.Name = "AuthSession"; }); builder.Services.AddEndpointsApiExplorer(); diff --git a/WorkFlow.API/appsettings.json b/WorkFlow.API/appsettings.json index f5166d5..89037e4 100644 --- a/WorkFlow.API/appsettings.json +++ b/WorkFlow.API/appsettings.json @@ -9,7 +9,7 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=g+2edXEbMbujCUjh7INZRQ==;Password=Bz/n9pu8EyzlVqicaMRQGQ==;Encrypt=false;TrustServerCertificate=True;" + "Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;" }, "DirectorySearchOptions": { "ServerName": "DD-VMP01-DC01",