IUserLoginStore<TUser> Interface

Summary

Provides an abstraction for storing information that maps external login information provided by Microsoft Account, Facebook etc. to a user account.

Syntax

public interface IUserLoginStore<TUser> : IUserStore<TUser>, IDisposable where TUser : class

GitHub

View on GitHub

interface Microsoft.AspNet.Identity.IUserLoginStore<TUser>

Methods

AddLoginAsync(TUser, Microsoft.AspNet.Identity.UserLoginInfo, System.Threading.CancellationToken)

Adds an external Microsoft.AspNet.Identity.UserLoginInfo to the specified user, as an asynchronous operation.

Arguments:
  • user ({TUser}) – The user to add the login to.
  • login (Microsoft.AspNet.Identity.UserLoginInfo) – The external Microsoft.AspNet.Identity.UserLoginInfo to add to 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 <see cref=”T: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, as an asynchronous operation..

Arguments:
  • loginProvider (System.String) – The login provider who provided the providerKey.
  • providerKey (System.String) – The key provided by the loginProvider 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 <see cref=”T: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” />, as an asynchronous operation.

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.AspNet.Identity.UserLoginInfo}}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> for the asynchronous operation, containing a list of <see cref=”T:Microsoft.AspNet.Identity.UserLoginInfo” /> for the specified <paramref name=”user” />, 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 user, as an asynchronous operation. 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 <see cref=”T:System.Threading.Tasks.Task” /> that contains a flag the result of the asynchronous removing operation. The flag will be true if the login information was existed and removed, otherwise false.

Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken)