CookieExtensions.AddCookie 方法

定義

多載

AddCookie(AuthenticationBuilder)

使用預設配置將 cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由指定 AuthenticationScheme

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

使用預設配置將 cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由指定 AuthenticationScheme

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

AddCookie(AuthenticationBuilder, String)

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

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

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

AddCookie(AuthenticationBuilder)

使用預設配置將 cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由指定 AuthenticationScheme

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ AddCookie(Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ builder);
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

參數

傳回

AuthenticationBuilder

作業 builder 完成之後的參考。

適用於

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

使用預設配置將 cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由指定 AuthenticationScheme

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ AddCookie(Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ builder, Action<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^> ^ configureOptions);
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

傳回

AuthenticationBuilder

作業 builder 完成之後的參考。

適用於

AddCookie(AuthenticationBuilder, String)

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ AddCookie(Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ builder, System::String ^ authenticationScheme);
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

驗證配置。

傳回

AuthenticationBuilder

作業 builder 完成之後的參考。

適用於

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ AddCookie(Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ builder, System::String ^ authenticationScheme, Action<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^> ^ configureOptions);
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

傳回

AuthenticationBuilder

作業 builder 完成之後的參考。

適用於

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

使用指定的配置,將 cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP cookie 來執行驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ AddCookie(Microsoft::AspNetCore::Authentication::AuthenticationBuilder ^ builder, System::String ^ authenticationScheme, System::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);
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

傳回

AuthenticationBuilder

作業 builder 完成之後的參考。

適用於