IUserLoginStore<TUser> Interface¶
Provides an abstraction for storing information that maps external login information provided by Microsoft Account, Facebook etc. to a user account.
- Namespace
Microsoft.AspNetCore.Identity
- Assemblies
- Microsoft.AspNetCore.Identity
Syntax¶
public interface IUserLoginStore<TUser> : IUserStore<TUser>, IDisposable where TUser : class
-
interface
Microsoft.AspNetCore.Identity.
IUserLoginStore<TUser>
¶
Methods¶
-
AddLoginAsync
(TUser, Microsoft.AspNetCore.Identity.UserLoginInfo, System.Threading.CancellationToken)¶ Adds an external
Microsoft.AspNetCore.Identity.UserLoginInfo
to the specified <em>user</em>.Arguments: - user (TUser) – The user to add the login to.
- login (Microsoft.AspNetCore.Identity.UserLoginInfo) – The external
Microsoft.AspNetCore.Identity.UserLoginInfo
to add to the specified <em>user</em>. - cancellationToken (System.Threading.CancellationToken) – The
System.Threading.CancellationToken
used to propagate notifications that the operation should be canceled.
Return type: System.Threading.Tasks.Task
Returns: The
System.Threading.Tasks.Task
that represents the asynchronous operation.Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken)
-
FindByLoginAsync
(System.String, System.String, System.Threading.CancellationToken)¶ Retrieves the user associated with the specified login provider and login provider key..
Arguments: - loginProvider (System.String) – The login provider who provided the <em>providerKey</em>.
- providerKey (System.String) – The key provided by the <em>loginProvider</em> to identify a user.
- cancellationToken (System.Threading.CancellationToken) – The
System.Threading.CancellationToken
used to propagate notifications that the operation should be canceled.
Return type: System.Threading.Tasks.Task<TUser>
Returns: The
System.Threading.Tasks.Task
for the asynchronous operation, containing the user, if any which matched the specified login provider and key.Task<TUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
-
GetLoginsAsync
(TUser, System.Threading.CancellationToken)¶ Retrieves the associated logins for the specified <param ref=”user” />.
Arguments: - user (TUser) – The user whose associated logins to retrieve.
- cancellationToken (System.Threading.CancellationToken) – The
System.Threading.CancellationToken
used to propagate notifications that the operation should be canceled.
Return type: System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.AspNetCore.Identity.UserLoginInfo>>
Returns: The
System.Threading.Tasks.Task
for the asynchronous operation, containing a list ofMicrosoft.AspNetCore.Identity.UserLoginInfo
for the specified <em>user</em>, if any.Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken)
-
RemoveLoginAsync
(TUser, System.String, System.String, System.Threading.CancellationToken)¶ Attempts to remove the provided login information from the specified <em>user</em>. and returns a flag indicating whether the removal succeed or not.
Arguments: - user (TUser) – The user to remove the login information from.
- loginProvider (System.String) – The login provide whose information should be removed.
- providerKey (System.String) – The key given by the external login provider for the specified user.
- cancellationToken (System.Threading.CancellationToken) – The
System.Threading.CancellationToken
used to propagate notifications that the operation should be canceled.
Return type: System.Threading.Tasks.Task
Returns: The
System.Threading.Tasks.Task
that represents the asynchronous operation.Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken)
-