Browse Source
`IntrospectAccessToken` in `Blazor.Server.Tiered`.
pull/15876/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
8 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs
|
|
|
@ -8,6 +8,12 @@ namespace Microsoft.AspNetCore.Authentication.Cookies; |
|
|
|
|
|
|
|
public static class CookieAuthenticationOptionsExtensions |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Introspect access token on validating the principal.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options"></param>
|
|
|
|
/// <param name="oidcAuthenticationScheme"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public static CookieAuthenticationOptions IntrospectAccessToken(this CookieAuthenticationOptions options, string oidcAuthenticationScheme = "oidc") |
|
|
|
{ |
|
|
|
var originalHandler = options.Events.OnValidatePrincipal; |
|
|
|
|
|
|
|
@ -4,6 +4,7 @@ using Blazorise.Bootstrap5; |
|
|
|
using Blazorise.Icons.FontAwesome; |
|
|
|
using Medallion.Threading; |
|
|
|
using Medallion.Threading.Redis; |
|
|
|
using Microsoft.AspNetCore.Authentication.Cookies; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.DataProtection; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
@ -163,6 +164,7 @@ public class MyProjectNameBlazorModule : AbpModule |
|
|
|
.AddCookie("Cookies", options => |
|
|
|
{ |
|
|
|
options.ExpireTimeSpan = TimeSpan.FromDays(365); |
|
|
|
options.IntrospectAccessToken(); |
|
|
|
}) |
|
|
|
.AddAbpOpenIdConnect("oidc", options => |
|
|
|
{ |
|
|
|
|