共用方式為


JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication 方法

定義

多載

UseJwtBearerAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)
已淘汰.
已淘汰.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

JwtBearerMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用持有人權杖處理功能。 此中介軟體瞭解在要求標頭中顯示的適當格式和保護權杖。 如果 Options.AuthenticationMode 為 Active,持有人權杖內的宣告會新增至目前要求的 IPrincipal User。 如果 Options.AuthenticationMode 是被動的,則不會修改目前的要求,但可以隨時使用 IAuthenticationManager AuthenticationAsync 從要求的持有人權杖取得宣告。 另請參閱 http://tools.ietf.org/html/rfc6749

UseJwtBearerAuthentication(IApplicationBuilder)

來源:
JwtBearerAppBuilderExtensions.cs
來源:
JwtBearerAppBuilderExtensions.cs

警告

UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseJwtBearerAuthentication(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
[System.Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", true)]
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
[System.Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", true)]
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
[<System.Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", true)>]
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
[<System.Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", true)>]
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseJwtBearerAuthentication (app As IApplicationBuilder) As IApplicationBuilder

參數

app
IApplicationBuilder

IApplicationBuilder要加入處理常式的 。

傳回

完成作業之後,這個執行個體的參考。

屬性

適用於

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

來源:
JwtBearerAppBuilderExtensions.cs
來源:
JwtBearerAppBuilderExtensions.cs

警告

UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseJwtBearerAuthentication(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Authentication::JwtBearer::JwtBearerOptions ^ options);
[System.Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", true)]
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions options);
[System.Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", true)]
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions options);
[<System.Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", true)>]
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
[<System.Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", true)>]
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseJwtBearerAuthentication (app As IApplicationBuilder, options As JwtBearerOptions) As IApplicationBuilder

參數

app
IApplicationBuilder

IApplicationBuilder要加入處理常式的 。

options
JwtBearerOptions

JwtBearerOptions 指定處理常式的選項。

傳回

完成作業之後,這個執行個體的參考。

屬性

適用於

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

JwtBearerMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用持有人權杖處理功能。 此中介軟體瞭解在要求標頭中顯示的適當格式和保護權杖。 如果 Options.AuthenticationMode 為 Active,持有人權杖內的宣告會新增至目前要求的 IPrincipal User。 如果 Options.AuthenticationMode 是被動的,則不會修改目前的要求,但可以隨時使用 IAuthenticationManager AuthenticationAsync 從要求的持有人權杖取得宣告。 另請參閱 http://tools.ietf.org/html/rfc6749

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseJwtBearerAuthentication(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::JwtBearerOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseJwtBearerAuthentication (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.JwtBearerOptions options);
static member UseJwtBearerAuthentication : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.JwtBearerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseJwtBearerAuthentication (app As IApplicationBuilder, options As JwtBearerOptions) As IApplicationBuilder

參數

app
IApplicationBuilder

IApplicationBuilder要加入中介軟體的 。

options
JwtBearerOptions

JwtBearerOptions 指定中介軟體的選項。

傳回

完成作業之後,這個執行個體的參考。

適用於