UserManager<TUser, TKey>.AccessFailedAsync Method

Increments the access failed count for the user and if the failed access account is greater than or equal to the MaxFailedAccessAttempsBeforeLockout, the user will be locked out for the next DefaultAccountLockoutTimeSpan and the AccessFailedCount will be reset to 0. This is used for locking out the user account.

Namespace:  Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

'Declaration
Public Overridable Function AccessFailedAsync ( _
    userId As TKey _
) As Task(Of IdentityResult)
'Usage
Dim instance As UserManager 
Dim userId As TKey
Dim returnValue As Task(Of IdentityResult)

returnValue = instance.AccessFailedAsync(userId)
public virtual Task<IdentityResult> AccessFailedAsync(
    TKey userId
)
public:
virtual Task<IdentityResult^>^ AccessFailedAsync(
    TKey userId
)
abstract AccessFailedAsync : 
        userId:'TKey -> Task<IdentityResult> 
override AccessFailedAsync : 
        userId:'TKey -> Task<IdentityResult> 
public function AccessFailedAsync(
    userId : TKey
) : Task<IdentityResult>

Parameters

  • userId
    Type: TKey
    The User ID.

Return Value

Type: System.Threading.Tasks.Task<IdentityResult>
The task representing the asynchronous operation.

See Also

Reference

UserManager<TUser, TKey> Class

Microsoft.AspNet.Identity Namespace

Other Resources

ASP.NET Identity