From 8ee541ceceaeb2ab00a1b9eb55dfc7978404fd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Mon, 11 Jul 2016 13:42:33 +0200 Subject: [PATCH] Introduce OpenIddictBuilder.SetAuthorizationCodeLifetime()/SetIdentityTokenLifetime() --- src/OpenIddict.Core/OpenIddictBuilder.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/OpenIddict.Core/OpenIddictBuilder.cs b/src/OpenIddict.Core/OpenIddictBuilder.cs index 8c102fb0..fe962912 100644 --- a/src/OpenIddict.Core/OpenIddictBuilder.cs +++ b/src/OpenIddict.Core/OpenIddictBuilder.cs @@ -529,6 +529,27 @@ namespace Microsoft.AspNetCore.Builder { return Configure(options => options.AccessTokenLifetime = lifetime); } + /// + /// Sets the authorization code lifetime, after which client applications + /// are unable to send a grant_type=authorization_code token request. + /// Using short-lived authorization codes is strongly recommended. + /// + /// The authorization code lifetime. + /// The . + public virtual OpenIddictBuilder SetAuthorizationCodeLifetime(TimeSpan lifetime) { + return Configure(options => options.AuthorizationCodeLifetime = lifetime); + } + + /// + /// Sets the identity token lifetime, after which client + /// applications should refuse processing identity tokens. + /// + /// The identity token lifetime. + /// The . + public virtual OpenIddictBuilder SetIdentityTokenLifetime(TimeSpan lifetime) { + return Configure(options => options.IdentityTokenLifetime = lifetime); + } + /// /// Sets the refresh token lifetime, after which client applications must get /// a new authorization from the user. When sliding expiration is enabled,