共用方式為


UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindByLoginAsync 方法

定義

擷取與指定之登入提供者和登入提供者金鑰相關聯的使用者。

public virtual System.Threading.Tasks.Task<TUser> FindByLoginAsync (string loginProvider, string providerKey, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<TUser> FindByLoginAsync (string loginProvider, string providerKey, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<TUser?> FindByLoginAsync (string loginProvider, string providerKey, System.Threading.CancellationToken cancellationToken = default);
abstract member FindByLoginAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser<'Key, 'UserClaim, 'UserRole, 'UserLogin>)>
override this.FindByLoginAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser<'Key, 'UserClaim, 'UserRole, 'UserLogin>)>
override this.FindByLoginAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.IdentityUser<'Key>)>
Public Overridable Function FindByLoginAsync (loginProvider As String, providerKey As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TUser)
Public Overrides Function FindByLoginAsync (loginProvider As String, providerKey As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TUser)

參數

loginProvider
String

提供 的 providerKey 登入提供者。

providerKey
String

提供的 loginProvider 金鑰,用來識別使用者。

cancellationToken
CancellationToken

用於散佈應取消作業通知的 CancellationToken

傳回

Task<TUser>

Task非同步作業的 ,如果符合指定的登入提供者和金鑰,則包含使用者。

實作

適用於