JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication 方法

定义

重载

UseJwtBearerAuthentication(IApplicationBuilder)
已过时。
已过时。

UseJwtBearerAuthentication 已过时。 配置 JwtBearer authentication with AddAuthentication () 。ConfigureServices 中的 AddJwtBearer。 有关详细信息,请参阅 https://go.microsoft.com/fwlink/?linkid=845470

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)
已过时。
已过时。

UseJwtBearerAuthentication 已过时。 配置 JwtBearer authentication with AddAuthentication () 。ConfigureServices 中的 AddJwtBearer。 有关详细信息,请参阅 https://go.microsoft.com/fwlink/?linkid=845470

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

JwtBearerMiddleware 中间件添加到指定的 IApplicationBuilder 中,这将启用持有者令牌处理功能。 此中间件了解在请求标头中显示的格式正确的受保护标记。 如果 AuthenticationMode 处于活动状态,持有者令牌中的声明将添加到当前请求的 IPrincipal 用户。 如果 AuthenticationMode 是被动的,则不会修改当前请求,但可以随时使用 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 已过时。 配置 JwtBearer authentication with AddAuthentication () 。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 添加处理程序的。

返回

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 已过时。 配置 JwtBearer authentication with AddAuthentication () 。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 ,它指定处理程序的选项。

返回

IApplicationBuilder

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

属性

适用于

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

JwtBearerMiddleware 中间件添加到指定的 IApplicationBuilder 中,这将启用持有者令牌处理功能。 此中间件了解在请求标头中显示的格式正确的受保护标记。 如果 AuthenticationMode 处于活动状态,持有者令牌中的声明将添加到当前请求的 IPrincipal 用户。 如果 AuthenticationMode 是被动的,则不会修改当前请求,但可以随时使用 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 ,它指定中间件的选项。

返回

IApplicationBuilder

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

适用于