語言

HttpConnectionDispatcherOptions.OnAuthenticationRefresh 屬性

定義

當 /refresh 端點成功重新驗證請求但連線使用者尚未被替換時,會呼叫一個可選回撥。 返回 true 以接受新主體,或 false 拒絕刷新。 當被拒絕時,端點會以 HTTP 403 回應,連線的當前使用者則保持原位。

public Func<Microsoft.AspNetCore.Connections.Features.AuthenticationRefreshContext,System.Threading.Tasks.Task<bool>>? OnAuthenticationRefresh { get; set; }
member this.OnAuthenticationRefresh : Func<Microsoft.AspNetCore.Connections.Features.AuthenticationRefreshContext, System.Threading.Tasks.Task<bool>> with get, set
Public Property OnAuthenticationRefresh As Func(Of AuthenticationRefreshContext, Task(Of Boolean))

屬性值

備註

此回調是附加於連線預設身份關聯檢查(或應用程式提供的 OnAuthenticationRefresh 覆寫)上的一項政策:兩者都必須接受刷新才能套用。 它無法用來繞過那個底層的身份驗證。

適用於