Для тех, кто хочет расширить существующих провайдеров, что-то вроде:
using System;
using System.Web;
using System.Web.Security;
namespace System.Web.MVC_Extensions
{
public static class SqlMembershipProviderExtensions
{
public static string GenerateAccessToken(this MembershipProvider provider, string username, int expiresInMinutes)
{
if (provider.GetType().Name != "SqlMembershipProvider")
throw new NotSupportedException("Access tokens only supported by SqlMembershipProvider.");
...
}
public static bool ValidateAccessToken(this MembershipProvider provider, string username, string token)
{
if (provider.GetType().Name != "SqlMembershipProvider")
throw new NotSupportedException("Access tokens only supported by SqlMembershipProvider.");
...
}
}
}