Base solution for your next web application
Open Closed

How to implement user management? #19


User avatar
0
damir created

I started my project based on the project generated by ABP. Now I need to add usermanagement with login functionality.

There is a Zero project that should offer this functionality but how to use it?

I checked out also the TaskEver project but it is not using the Zero module. I had also problems getting it to run.

Wha is the best way to implement user management?

Best regards, Damir


6 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    You can extend and use AbpUserManager as shown in module-zero sample. It has all methods to manage (create, update, delete, list, add to roles...) users. You can also use RoleManager. Even you can use repositories if you really need.

  • User Avatar
    0
    damir created

    Thank you for your help!

    I checked out the sample application in Zero module. This implementation is working and is exactly what I need. I tried to implement it the similar way in my application that is using NHibernate instead of EF.

    I added the needed references and code. The problem is I am missing NH mapping files. I am getting error: NHibernate.MappingException: No persister for: TestProject.Users.User

    I see that the mappings already exist in your Zero.NHibernate project.

    How to use the existing mappings? What am I missing?

    Best regards, Damir

  • User Avatar
    0
    hubert created

    I guess you have to add the mapping to fluent NH configuration. In the project Xxx.NHibernate please see the code of XxxDataModule:

    Configuration.DefaultNameOrConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
                Configuration.Modules.AbpNHibernate().FluentConfiguration
                    .Database(MsSqlConfiguration.MsSql2008.ConnectionString(Configuration.DefaultNameOrConnectionString))
                    .Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));
    

    All you need to do is add mapping line pointing to referenced Zero.NHibernate

  • User Avatar
    0
    damir created

    Thx for the hint. I already tried this but with no luck. In couple of variations of my code I managed to get some tables into the DB ( see image ) but this is still far from a working solution.

    I would realy like to use ABP in a project but first I need to solve the user management.

    Is there a working demo of the module Zero sample aplication in combination with NHibernate?

    Regards, Damir

  • User Avatar
    0
    hikalkan created
    Support Team

    NHibernate side is a little out-of-date for module-zero. This is a little normal since I did not documented module-zero and it's work-in-progress. It will be fixed soon. But if you can write missing migrations (based on current state of entities, also maybe running EF migration and see what tables are created) and create mappings, you can contribute to the project source in github.

  • User Avatar
    0
    lcyhjx created

    Is there a way that I invoke the authenticated ASP.net Web API on Mobility side? For example, an android application or an HTM5 based mobility application?