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 处于活动状态,持有者令牌中的声明将添加到当前请求的 IPrincipal 用户。 如果 Options.AuthenticationMode 为 Passive,则当前请求不会修改,但可以随时使用 IAuthenticationManager AuthenticateAsync 从请求的持有者令牌获取声明。 另请参阅 http://tools.ietf.org/html/rfc6749

UseJwtBearerAuthentication(IApplicationBuilder)

注意

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)

注意

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 处于活动状态,持有者令牌中的声明将添加到当前请求的 IPrincipal 用户。 如果 Options.AuthenticationMode 为 Passive,则当前请求不会修改,但可以随时使用 IAuthenticationManager AuthenticateAsync 从请求的持有者令牌获取声明。 另请参阅 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 ,它指定中间件的选项。

返回

完成操作后对此实例的引用。

适用于