Base solution for your next web application

Activities of "zana"

added

  1. enabled $locationProvider.html5Mode with ... $locationProvider.html5Mode(true);
  2. <base href="/" /> to layout <head />.

but navigation not worked with html5 mode true

I customs Email Service and integrated with external email provider Sendgrid, and assign class "EmailService" to EmailService property via UserManager constructor

As UserManager constructor:

        this.EmailService = new EmailService();
        this.SmsService = new SmsService();

and Create Classes

  1. public class EmailService : IIdentityMessageService
     {
          public Task SendAsync(IdentityMessage message)
    
  2.   public class SmsService : IIdentityMessageService
     {
         public Task SendAsync(IdentityMessage message)
    

But NO hit :(

Yes, Im using "mudule zero" template :), and there is already a UserManager class in the solution. I need Send email by UserManager.SendEmailAsync, and implment this code:

public class EmailService : IIdentityMessageService { public Task SendAsync(IdentityMessage message) { // Plug in your email service here to send an email. return configSendGridasync(message); //return Task.FromResult(0); }

How can I assign the ‘EmailService’ property on the UserManager to the ‘EmailService’ class Can I extend the UserManager : AbpUserManager<Tenant, Role, User> in IdentityConfig?

ex: /***************************************/ public class ApplicationRoleManager : RoleManager<IdentityRole> { public ApplicationRoleManager(IRoleStore<IdentityRole,string> roleStore) : base(roleStore) { }

    public static ApplicationRoleManager Create(IdentityFactoryOptions&lt;ApplicationRoleManager&gt; options, IOwinContext context)
    {
        return new ApplicationRoleManager(new RoleStore&lt;IdentityRole&gt;(context.Get&lt;ApplicationDbContext&gt;()));
    }
}

public class EmailService : IIdentityMessageService

/***********************************/

now it works <a class="postlink" href="http://stackoverflow.com/questions/22629936/no-iusertokenprovider-is-registered">http://stackoverflow.com/questions/2262 ... registered</a>

UserManager.UserTokenProvider = new DataProtectorTokenProvider<User, long>(provider.Create("EmailConfirmation")) as IUserTokenProvider<User, long>; var code = await _userManager.GenerateEmailConfirmationTokenAsync(user.Id);

yes, I changed User entity and added Add-Migration ...and update-database -verbos... updated database wirh update-database -verbos... , its woriking now but get Error for this statement:

var pass = _userManager.ResetPassword(user.Id, resetToken.ToString(), new PasswordHasher().HashPassword("1q2w3e4r"));

the error is No IUserTokenProvider is registered.

I need to GenerateEmailConfirmationTokenAsync, and must implement IUserTokenProvider. I drive class UserManager : AbpUserManager<Tenant, Role, User>, IUserTokenProvider<User, long>

implememted the interface public Task<string> GenerateAsync(string purpose, UserManager<User, long> manager, User user) { Guid resetToken = Guid.NewGuid(); user.PasswordResetToken = resetToken; manager.UpdateAsync(user); return Task.FromResult<string>(resetToken.ToString()); }

    public Task&lt;bool&gt; IsValidProviderForUserAsync(UserManager&lt;User, long&gt; manager, User user)
    {
        if (manager == null) throw new ArgumentNullException();
        else
        {
            return Task.FromResult&lt;bool&gt;(manager.SupportsUserPassword);
        }
    }

    public Task NotifyAsync(string token, UserManager&lt;User, long&gt; manager, User user)
    {

        return Task.FromResult&lt;int&gt;(0);
    }

    public Task&lt;bool&gt; ValidateAsync(string purpose, string token, UserManager&lt;User, long&gt; manager, User user)
    {
        return Task.FromResult&lt;bool&gt;(user.PasswordResetToken.ToString() == token);
    }

added a property PasswordResetToken to User : AbpUser<Tenant, User>

But get Error, DbContext' context has changed since the database was created. Could you explain how to implement IUserTokenProvider, for usermanager

Showing 1 to 7 of 7 entries