IUserLockoutStore<TUser> Interface¶
Summary¶
Provides an abstraction for a storing information which can be used to implement account lockout, including access failures and lockout status
Syntax¶
public interface IUserLockoutStore<TUser> : IUserStore<TUser>, IDisposable where TUser : class
Methods¶
-
GetAccessFailedCountAsync
(TUser, System.Threading.CancellationToken)¶ Retrieves the current failed access count for the specified
user
, as an asynchronous operation..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 <see cref=”T: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, as an asynchronous operation.
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 <see cref=”T: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, as an asynchronous operation. 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 <see cref=”T:System.Threading.Tasks.Task`1” /> that represents the result of the asynchronous query, a <see cref=”T: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, as an asynchronous operation.
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 <see cref=”T: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, as an asynchronous operation.
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 <see cref=”T: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
user
can be locked out, as an asynchronous operation..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
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 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, as an asynchronous operation. 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
user
‘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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation.
Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken)
-