SecurityStampValidator.OnValidateIdentity Method

 

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

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static OnValidateIdentity<TManager, TUser>(TimeSpan, Func<TManager, TUser, Task<ClaimsIdentity>>)

Can be used as the ValidateIdentity method for a CookieAuthenticationProvider which will check a user's security stamp after validateInterval.

System_CAPS_pubmethodSystem_CAPS_static OnValidateIdentity<TManager, TUser, TKey>(TimeSpan, Func<TManager, TUser, Task<ClaimsIdentity>>, Func<ClaimsIdentity, TKey>)

Can be used as the ValidateIdentity method for a CookieAuthenticationProvider which will check a user's security stamp after validateInterval.

See Also

SecurityStampValidator Class
Microsoft.AspNet.Identity.Owin Namespace

Return to top

SecurityStampValidator.OnValidateIdentity<TManager, TUser> Method (TimeSpan, Func<TManager, TUser, Task<ClaimsIdentity>>)

Can be used as the ValidateIdentity method for a CookieAuthenticationProvider which will check a user's security stamp after validateInterval.

Syntax

public static Func<CookieValidateIdentityContext, Task> OnValidateIdentity<TManager, TUser>(
    TimeSpan validateInterval,
    Func<TManager, TUser, Task<ClaimsIdentity>> regenerateIdentity
)
where TManager : UserManager<TUser, string>
where TUser : class, IUser<string>
public:
generic<typename TManager, typename TUser>
where TManager : UserManager<TUser, String^>
where TUser : ref class, IUser<String^>
static Func<CookieValidateIdentityContext^, Task^>^ OnValidateIdentity(
    TimeSpan validateInterval,
    Func<TManager, TUser, Task<ClaimsIdentity^>^>^ regenerateIdentity
)
static member OnValidateIdentity<'TManager, 'TUser when 'TManager : UserManager<'TUser, string> when 'TUser : not struct and IUser<string>> : 
        validateInterval:TimeSpan *
        regenerateIdentity:Func<'TManager, 'TUser, Task<ClaimsIdentity>> -> Func<CookieValidateIdentityContext, Task>
Public Shared Function OnValidateIdentity(Of TManager As UserManager(Of TUser, String), TUser As { Class, IUser(Of String) }) (
    validateInterval As TimeSpan,
    regenerateIdentity As Func(Of TManager, TUser, Task(Of ClaimsIdentity))
) As Func(Of CookieValidateIdentityContext, Task)

Parameters

  • validateInterval
    Type: System.TimeSpan

    The task representing the validateInterval.

Return Value

Type: System.Func<CookieValidateIdentityContext, Task>

The function that executes the ValidateIdentity.

Type Parameters

  • TManager
    The type of the manager.
  • TUser
    The type of the user.

Remarks

Rejects the identity if the stamp changes, and otherwise will call regenerateIdentity to sign in a new ClaimsIdentity.

See Also

ASP.NET Identity

Return to top

SecurityStampValidator.OnValidateIdentity<TManager, TUser, TKey> Method (TimeSpan, Func<TManager, TUser, Task<ClaimsIdentity>>, Func<ClaimsIdentity, TKey>)

Can be used as the ValidateIdentity method for a CookieAuthenticationProvider which will check a user's security stamp after validateInterval.

Syntax

public static Func<CookieValidateIdentityContext, Task> OnValidateIdentity<TManager, TUser, TKey>(
    TimeSpan validateInterval,
    Func<TManager, TUser, Task<ClaimsIdentity>> regenerateIdentityCallback,
    Func<ClaimsIdentity, TKey> getUserIdCallback
)
where TManager : UserManager<TUser, TKey>
where TUser : class, IUser<TKey>
where TKey : object, IEquatable<TKey>
public:
generic<typename TManager, typename TUser, typename TKey>
where TManager : UserManager<TUser, TKey>
where TUser : ref class, IUser<TKey>
where TKey : Object, IEquatable<TKey>
static Func<CookieValidateIdentityContext^, Task^>^ OnValidateIdentity(
    TimeSpan validateInterval,
    Func<TManager, TUser, Task<ClaimsIdentity^>^>^ regenerateIdentityCallback,
    Func<ClaimsIdentity^, TKey>^ getUserIdCallback
)
static member OnValidateIdentity<'TManager, 'TUser, 'TKey when 'TManager : UserManager<'TUser, 'TKey> when 'TUser : not struct and IUser<'TKey> when 'TKey : Object and IEquatable<'TKey>> : 
        validateInterval:TimeSpan *
        regenerateIdentityCallback:Func<'TManager, 'TUser, Task<ClaimsIdentity>> *
        getUserIdCallback:Func<ClaimsIdentity, 'TKey> -> Func<CookieValidateIdentityContext, Task>
Public Shared Function OnValidateIdentity(Of TManager As UserManager(Of TUser, TKey), TUser As { Class, IUser(Of TKey) }, TKey As { Object, IEquatable(Of TKey) }) (
    validateInterval As TimeSpan,
    regenerateIdentityCallback As Func(Of TManager, TUser, Task(Of ClaimsIdentity)),
    getUserIdCallback As Func(Of ClaimsIdentity, TKey)
) As Func(Of CookieValidateIdentityContext, Task)

Parameters

  • validateInterval
    Type: System.TimeSpan

    The task representing the validateInterval.

Return Value

Type: System.Func<CookieValidateIdentityContext, Task>

The function that executes the ValidateIdentity.

Type Parameters

  • TManager
    The type of the manager.
  • TUser
    The type of the user.
  • TKey
    The type of the key.

Remarks

Rejects the identity if the stamp changes, and otherwise will call regenerateIdentity to sign in a new ClaimsIdentity.

See Also

ASP.NET Identity

Return to top