Telegram Group & Telegram Channel
🔐 AuthenticationProperties в ASP.NET Core — недооценённый, но важный механизм

Если вы используете куки или OpenID Connect в ASP.NET Core, то наверняка сталкивались с объектом AuthenticationProperties. Он не просто "дополнительные параметры" — это мощный инструмент управления поведением аутентификации.

💡 Что можно сделать с AuthenticationProperties:

Установить срок действия куки:

new AuthenticationProperties { ExpiresUtc = DateTimeOffset.UtcNow.AddHours(1) }


↩️ Указать URL возврата после логина:


new AuthenticationProperties { RedirectUri = "/dashboard" }


🧭 Добавить временные метки, элементы состояния, флаги:
Например, IsPersistent, IssuedUtc, AllowRefresh, и кастомные значения.

🧠 Используется в:

HttpContext.SignInAsync(...)

ChallengeAsync(...) для OIDC

редиректах после логина/логаута

🛠️ Это ключевой объект, если вы хотите более гибко управлять логикой входа, выхода и жизненным циклом сессии в ASP.NET Core.

📎 Полный разбор:
https://blog.duendesoftware.com/posts/20250527-the-role-of-authenticationproperties-in-aspnet-core

@csharp_ci



tg-me.com/csharp_ci/1391
Create:
Last Update:

🔐 AuthenticationProperties в ASP.NET Core — недооценённый, но важный механизм

Если вы используете куки или OpenID Connect в ASP.NET Core, то наверняка сталкивались с объектом AuthenticationProperties. Он не просто "дополнительные параметры" — это мощный инструмент управления поведением аутентификации.

💡 Что можно сделать с AuthenticationProperties:

Установить срок действия куки:


new AuthenticationProperties { ExpiresUtc = DateTimeOffset.UtcNow.AddHours(1) }


↩️ Указать URL возврата после логина:


new AuthenticationProperties { RedirectUri = "/dashboard" }


🧭 Добавить временные метки, элементы состояния, флаги:
Например, IsPersistent, IssuedUtc, AllowRefresh, и кастомные значения.

🧠 Используется в:

HttpContext.SignInAsync(...)

ChallengeAsync(...) для OIDC

редиректах после логина/логаута

🛠️ Это ключевой объект, если вы хотите более гибко управлять логикой входа, выхода и жизненным циклом сессии в ASP.NET Core.

📎 Полный разбор:
https://blog.duendesoftware.com/posts/20250527-the-role-of-authenticationproperties-in-aspnet-core

@csharp_ci

BY C# (C Sharp) programming




Share with your friend now:
tg-me.com/csharp_ci/1391

View MORE
Open in Telegram


C C Sharp programming Telegram | DID YOU KNOW?

Date: |

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

The lead from Wall Street offers little clarity as the major averages opened lower on Friday and then bounced back and forth across the unchanged line, finally finishing mixed and little changed.The Dow added 33.18 points or 0.10 percent to finish at 34,798.00, while the NASDAQ eased 4.54 points or 0.03 percent to close at 15,047.70 and the S&P 500 rose 6.50 points or 0.15 percent to end at 4,455.48. For the week, the Dow rose 0.6 percent, the NASDAQ added 0.1 percent and the S&P gained 0.5 percent.The lackluster performance on Wall Street came on uncertainty about the outlook for the markets following recent volatility.

C C Sharp programming from us


Telegram C# (C Sharp) programming
FROM USA