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,