CookieExtensions.AddCookie 方法

定义

重载

AddCookie(AuthenticationBuilder)

使用默认方案将 AuthenticationBuilder Cookie 身份验证添加到 。 默认方案由 AuthenticationScheme指定。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

使用默认方案将 AuthenticationBuilder Cookie 身份验证添加到 。 默认方案由 AuthenticationScheme指定。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String, String, Action<CookieAuthenticationOptions>)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder)

使用默认方案将 AuthenticationBuilder Cookie 身份验证添加到 。 默认方案由 AuthenticationScheme指定。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder);
static member AddCookie : Microsoft.AspNetCore.Authentication.AuthenticationBuilder -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddCookie (builder As AuthenticationBuilder) As AuthenticationBuilder

参数

返回

操作完成后对 builder 的引用。

适用于

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

使用默认方案将 AuthenticationBuilder Cookie 身份验证添加到 。 默认方案由 AuthenticationScheme指定。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> configureOptions);
static member AddCookie : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddCookie (builder As AuthenticationBuilder, configureOptions As Action(Of CookieAuthenticationOptions)) As AuthenticationBuilder

参数

configureOptions
Action<CookieAuthenticationOptions>

用于配置 CookieAuthenticationOptions的委托。

返回

操作完成后对 builder 的引用。

适用于

AddCookie(AuthenticationBuilder, String)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme);
static member AddCookie : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddCookie (builder As AuthenticationBuilder, authenticationScheme As String) As AuthenticationBuilder

参数

authenticationScheme
String

身份验证方案。

返回

操作完成后对 builder 的引用。

适用于

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> configureOptions);
static member AddCookie : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string * Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddCookie (builder As AuthenticationBuilder, authenticationScheme As String, configureOptions As Action(Of CookieAuthenticationOptions)) As AuthenticationBuilder

参数

authenticationScheme
String

身份验证方案。

configureOptions
Action<CookieAuthenticationOptions>

用于配置 CookieAuthenticationOptions的委托。

返回

操作完成后对 builder 的引用。

适用于

AddCookie(AuthenticationBuilder, String, String, Action<CookieAuthenticationOptions>)

使用指定方案将 AuthenticationBuilder Cookie 身份验证添加到 。

Cookie 身份验证使用保存在客户端中的 HTTP Cookie 来执行身份验证。

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> configureOptions);
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddCookie (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> configureOptions);
static member AddCookie : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string * string * Action<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddCookie (builder As AuthenticationBuilder, authenticationScheme As String, displayName As String, configureOptions As Action(Of CookieAuthenticationOptions)) As AuthenticationBuilder

参数

authenticationScheme
String

身份验证方案。

displayName
String

身份验证处理程序的显示名称。

configureOptions
Action<CookieAuthenticationOptions>

用于配置 CookieAuthenticationOptions的委托。

返回

操作完成后对 builder 的引用。

适用于