IUserLockoutStore<TUser> Interface

Provides an abstraction for a storing information which can be used to implement account lockout, including access failures and lockout status

Namespace
Microsoft.AspNetCore.Identity
Assemblies
  • Microsoft.AspNetCore.Identity

Syntax

public interface IUserLockoutStore<TUser> : IUserStore<TUser>, IDisposable where TUser : class
interface Microsoft.AspNetCore.Identity.IUserLockoutStore<TUser>

Methods

GetAccessFailedCountAsync(TUser, System.Threading.CancellationToken)

Retrieves the current failed access count for the specified <em>user</em>..

Arguments:
  • user (TUser) – The user whose failed access count should be retrieved.
  • 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.Int32>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the failed access count.

Task<int> GetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken)
GetLockoutEnabledAsync(TUser, System.Threading.CancellationToken)

Retrieves a flag indicating whether user lockout can enabled for the specified user.

Arguments:
  • user (TUser) – The user whose ability to be locked out should be returned.
  • 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.Boolean>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, true if a user can be locked out, otherwise false.

Task<bool> GetLockoutEnabledAsync(TUser user, CancellationToken cancellationToken)
GetLockoutEndDateAsync(TUser, System.Threading.CancellationToken)

Gets the last System.DateTimeOffset a user’s last lockout expired, if any. Any time in the past should be indicates a user is not locked out.

Arguments:
  • user (TUser) – The user whose lockout date should be retrieved.
  • 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.Nullable<System.DateTimeOffset>>

Returns:

A System.Threading.Tasks.Task`1 that represents the result of the asynchronous query, a System.DateTimeOffset containing the last time a user’s lockout expired, if any.

Task<DateTimeOffset? > GetLockoutEndDateAsync(TUser user, CancellationToken cancellationToken)
IncrementAccessFailedCountAsync(TUser, System.Threading.CancellationToken)

Records that a failed access has occurred, incrementing the failed access count.

Arguments:
  • user (TUser) – The user whose cancellation count should be incremented.
  • 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.Int32>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the incremented failed access count.

Task<int> IncrementAccessFailedCountAsync(TUser user, CancellationToken cancellationToken)
ResetAccessFailedCountAsync(TUser, System.Threading.CancellationToken)

Resets a user’s failed access count.

Arguments:
  • user (TUser) – The user whose failed access count should be reset.
  • 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 ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken)
SetLockoutEnabledAsync(TUser, System.Boolean, System.Threading.CancellationToken)

Set the flag indicating if the specified <em>user</em> can be locked out..

Arguments:
  • user (TUser) – The user whose ability to be locked out should be set.
  • enabled (System.Boolean) – A flag indicating if lock out can be enabled for 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 SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken)
SetLockoutEndDateAsync(TUser, System.Nullable<System.DateTimeOffset>, System.Threading.CancellationToken)

Locks out a user until the specified end date has passed. Setting a end date in the past immediately unlocks a user.

Arguments:
  • user (TUser) – The user whose lockout date should be set.
  • lockoutEnd (System.Nullable<System.DateTimeOffset>) – The System.DateTimeOffset after which the <em>user</em>’s lockout should end.
  • 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 SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken)