From af934a2beef4cd7542ba7c6fb5c29be144f1b2b0 Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Mon, 2 Jun 2025 18:07:24 -0400 Subject: [PATCH] PM-20532 - SendClientBuilder.cs and GlobalSettings.cs - wire up SendAccessTokenLifetimeInMinutes as global setting and consume in send client builder --- src/Core/Settings/GlobalSettings.cs | 2 ++ src/Identity/IdentityServer/StaticClients/SendClientBuilder.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Core/Settings/GlobalSettings.cs b/src/Core/Settings/GlobalSettings.cs index b821f214db..cb4cf0086c 100644 --- a/src/Core/Settings/GlobalSettings.cs +++ b/src/Core/Settings/GlobalSettings.cs @@ -87,6 +87,8 @@ public class GlobalSettings : IGlobalSettings public virtual IPhishingDomainSettings PhishingDomain { get; set; } = new PhishingDomainSettings(); public virtual bool EnableEmailVerification { get; set; } + + public virtual int SendAccessTokenLifetimeInMinutes { get; set; } = 5; public virtual string KdfDefaultHashKey { get; set; } public virtual string PricingUri { get; set; } diff --git a/src/Identity/IdentityServer/StaticClients/SendClientBuilder.cs b/src/Identity/IdentityServer/StaticClients/SendClientBuilder.cs index ac72ff3500..3c40e46a3e 100644 --- a/src/Identity/IdentityServer/StaticClients/SendClientBuilder.cs +++ b/src/Identity/IdentityServer/StaticClients/SendClientBuilder.cs @@ -13,7 +13,7 @@ public static class SendClientBuilder { ClientId = BitwardenClient.Send, AllowedGrantTypes = new[] { SendAccessGrantValidator.GrantType }, - AccessTokenLifetime = 60 * 5, // 5 minutes // TODO: convert this to a global setting + AccessTokenLifetime = 60 * globalSettings.SendAccessTokenLifetimeInMinutes, // Do not allow refresh tokens to be issued. AllowOfflineAccess = false,