JwtBearerExtensions.AddJwtBearer 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddJwtBearer(AuthenticationBuilder) |
使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。
JWT 持有人驗證會從 |
AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>) |
使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。
JWT 持有人驗證會從 |
AddJwtBearer(AuthenticationBuilder, String) |
使用預先定義的配置來啟用 JWT 持有人驗證。
JWT 持有人驗證會從 |
AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>) |
使用指定的配置啟用 JWT 持有人驗證。
JWT 持有人驗證會從 |
AddJwtBearer(AuthenticationBuilder, String, String, Action<JwtBearerOptions>) |
使用指定的配置啟用 JWT 持有人驗證。
JWT 持有人驗證會從 |
AddJwtBearer(AuthenticationBuilder)
使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。
JWT 持有人驗證會從 Authorization
要求標頭擷取和驗證 JWT 權杖,以執行驗證。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder);
static member AddJwtBearer : Microsoft.AspNetCore.Authentication.AuthenticationBuilder -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddJwtBearer (builder As AuthenticationBuilder) As AuthenticationBuilder
參數
傳回
作業完成之後的 builder
參考。
適用於
AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>)
使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。
JWT 持有人驗證會從 Authorization
要求標頭擷取和驗證 JWT 權杖,以執行驗證。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);
static member AddJwtBearer : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddJwtBearer (builder As AuthenticationBuilder, configureOptions As Action(Of JwtBearerOptions)) As AuthenticationBuilder
參數
- configureOptions
- Action<JwtBearerOptions>
允許設定 JwtBearerOptions 的委派。
傳回
作業完成之後的 builder
參考。
適用於
AddJwtBearer(AuthenticationBuilder, String)
使用預先定義的配置來啟用 JWT 持有人驗證。
JWT 持有人驗證會從 Authorization
要求標頭擷取和驗證 JWT 權杖,以執行驗證。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme);
static member AddJwtBearer : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddJwtBearer (builder As AuthenticationBuilder, authenticationScheme As String) As AuthenticationBuilder
參數
- authenticationScheme
- String
驗證配置。
傳回
作業完成之後的 builder
參考。
適用於
AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>)
使用指定的配置啟用 JWT 持有人驗證。
JWT 持有人驗證會從 Authorization
要求標頭擷取和驗證 JWT 權杖,以執行驗證。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);
static member AddJwtBearer : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string * Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddJwtBearer (builder As AuthenticationBuilder, authenticationScheme As String, configureOptions As Action(Of JwtBearerOptions)) As AuthenticationBuilder
參數
- authenticationScheme
- String
驗證配置。
- configureOptions
- Action<JwtBearerOptions>
允許設定 JwtBearerOptions 的委派。
傳回
作業完成之後的 builder
參考。
適用於
AddJwtBearer(AuthenticationBuilder, String, String, Action<JwtBearerOptions>)
使用指定的配置啟用 JWT 持有人驗證。
JWT 持有人驗證會從 Authorization
要求標頭擷取和驗證 JWT 權杖,以執行驗證。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);
static member AddJwtBearer : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string * string * Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddJwtBearer (builder As AuthenticationBuilder, authenticationScheme As String, displayName As String, configureOptions As Action(Of JwtBearerOptions)) As AuthenticationBuilder
參數
- authenticationScheme
- String
驗證配置。
- displayName
- String
驗證處理常式的顯示名稱。
- configureOptions
- Action<JwtBearerOptions>
允許設定 JwtBearerOptions 的委派。
傳回
作業完成之後的 builder
參考。