Skip to content

Commit 75e9c23

Browse files
committed
add file
1 parent fab8b7f commit 75e9c23

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

support/entra/entra-id/app-integration/customize-authentication-session-expiration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Update ASP.NET or ASP.NET Core App Session to Last Longer Than Entra ID Tokens
3-
description: Describes a problem in which Microsoft Entra ID is sending the token to an incorrect reply URL endpoint or localhost.
4-
ms.date: 08/26/2022
5-
ms.reviewer: bernawy
2+
title: Configure ASP.NET or ASP.NET Core App Session to Last Longer Than Entra ID Tokens
3+
description: Describes how to configure ASP.NET or ASP.NET Core App session to last longer than Microsoft Entra ID token.
4+
ms.date: 05/31/2025
5+
ms.reviewer: willfid
66
ms.service: entra-id
77
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
88
---
9-
# Update ASP.NET or ASP.NET Core App Session to Last Longer Than Azure AD Tokens
9+
# Customize Middleware authentication ticket to extend user sign-in time
1010

11-
Microsoft Entra ID tokens (ID tokens, access tokens, and SAML tokens) by default last one hour. Asp.Net and Asp.Net Core Middleware set their authentication ticket to the expiration of these tokens by default. If you do not want your web application to redirect users to Microsoft Entra ID to sign in again, you can customize the Middleware authentication ticket.
11+
Microsoft Entra ID tokens (ID tokens, access tokens, and SAML tokens) by default expire after one hour. ASP.NET and ASP.NET Core Middleware set their authentication ticket to the expiration of these tokens by default. If you don't want your web application to redirect users to Microsoft Entra ID to sign in again, you can customize the Middleware authentication ticket.
1212

1313
This customization can also help resolve AJAX issues (such as CORS errors to `login.microsoftonline.com`) where your app is both a Web App and Web API.
1414

@@ -40,9 +40,9 @@ app.UseOpenIdConnectAuthentication(
4040

4141
```
4242

43-
## For Asp.Net Core
43+
## For ASP.NET Core
4444

45-
In ASP.NET Core, you need to add the `OnTokenValidated` event to update the ticket properties. This sets the ticket expiration time before the application redirects to Microsoft Entra ID for re-authentication.
45+
In ASP.NET Core, you need to add the `OnTokenValidated` event to update the ticket properties. This sets the ticket expiration time before the application redirects to Microsoft Entra ID for reauthentication.
4646

4747
```
4848
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
@@ -184,7 +184,7 @@ services.Configure<OpenIdConnectOptions>(options =>
184184
});
185185
```
186186

187-
If you're integrating a Asp.Net Core WS-Fed application, then it might look something like the following:
187+
If you're integrating a ASP.NET Core WS-Fed application, then it might look something like the following:
188188

189189
```csharp
190190
public void ConfigureServices(IServiceCollection services)

0 commit comments

Comments
 (0)