ASP.NET MVC and User Authentication with NHibernate - asp.net

I am about to start a new application and am excited about using asp.net mvc and nhibernate. However, the big "problem" is how I handle the user authentication stuff. What are some ways those used to using nhibernate and MVC solve this problem?
My thought is let asp.net do its own thing and I do my own thing database wise. Am curios if I should role my own using the provider model and nhibernate, if I can figure out how. Or is there a way to integrate current code that is in the mvc example into nhibernate?

You can still use the ASP .NET 2.0 Membership APIs from ASP .NET MVC.

Same question here and Manuel Abadia has written a custom NHMembershipProvider here.

4 guys from rolla have an excellent post if you want to buil your own provider on top of the asp.net membership API : https://web.archive.org/web/20211020114106/https://www.4guysfromrolla.com/articles/110310-1.aspx

Related

Login and register on ASP.NET MVC 5/6

I'm beginning with asp.net mvc and I'd like to learn to the best way for user registration and login whitch is used in real projects. Please, can anyone share good tutorial for beginner? Thanks
You can find a lot of tutorials if you google "ASP.NET Identity 2.X". Here is one I found ASP.NET Identity Tutorial
This should give you a foundation to build on if you need to do something more complex.
You can use Membership api for user creation and login, And it is widely used in real projects.
check this link:-
https://msdn.microsoft.com/library/879kf95c(v=vs.100).aspx

ASP.Net Identity using DevExpress ORM instead of Entity Framework

I'm implementing ASP.Net Identity for my MVC web application.
Could someone profide hints on how to use DevEx ORM and not Entity Framework?
Thanks in advance.
I got this answer from DevEx team:
Hi Muris,
ASP.NET Identity Framework is highly dependable on the Entity Framework, therefore it is required to write a lot of custom code to utilize it with other ORM. What we plan to do in the context of the Add support for VS2013 authentication modes ticket is to support selecting the ASP.NET Identity as an authentication provider when creating a new project using the Project Wizard. Since our Project Wizard uses Entity Framework as a data provider, we will also use it to support the ASP.NET Identity authentication.

Additional user information using EF5, MVC4 (with MVC3 AccountController) and ASP.NET Membership provider

I am trying to build an MVC 4 app with MySQL as database and using asp.net System.Web.Providers, Entity Framework 5 with Code First approach. So far it's been hell!
I have made it work using MVC 3 AccountModel (since my mysql connector does not support the SimpleMembership yet).
So far users can be created, but I would like to have a little more information about the users stored in the database, e.g. what post they have authored, their website, etc.
For this purpose I have created a UserProfile class that stores this information.
How do I relate my UserProfile class to the asp.net auth-stuff, so I can get the extra user stuff, whenever I have my MembershipUser available?
Is the reverse possible?
Without more information it is hard to answer your question.
In general regards to MVC3 Membership, it sounds like you would be best looking at a custom membership provider. Try these for help
Code Project - Custom Membership Providers
ASP.NET MVC 2 Custom Membership Provider Tutorial
ASP.Net MVC 3 Custom Membership Provider with Repository Injection
or maybe the links in this StackOverflow answer
If custom membership seems over the top, you could try creating separate models that map to the UserProfile as mentioned in this and this.
Hope this is helpful.

How do I use Entity Framework 4.1 with MVC 3 Login

I am building my first EF 4.1 code first application in mvc3. How do I incorporate the mvc3 login with my EF4.1 classes?
or maybe the question should be, how do I build the same login functionality into my EF4.1 classes?
My EF classes will contain user information, which is what I want to use for the login.
any suggestions are appretiated.
Please see asp.net/mvc for a bunch of great tutorials about ASP.NET MVC. Also here is a good link on user authentication.
As i understand from your question, you will need to implement Custom Membership Provider and override all the properties you need...refer to this article fro complete information..
http://www.mattwrock.com/post/2009/10/14/Implementing-custom-Membership-Provider-and-Role-Provider-for-Authinticating-ASPNET-MVC-Applications.aspx

How to mix two asp.net projects: WebForms for backend and MVC for frontend on the same domain?

We are developing an application and want to separate it into two projects. The first project for end users will be on asp.net mvc, and the second for administration will be on asp.net webforms because simple crud operations perform easier on webforms and there are many out of the box controls. Problems:
share same authentication system
access to backend via site.com/backend
Piece of cake.
The backbone of Authentication is part of Asp.net's core. MVC and WebForms share things like the FormsAuthentication cookies and Membership Providers
WebForms and MVC get along just fine. All you really need to do is set routes.RouteExistingFiles = true; in global.asax for your /backend/ subdirectory and MVC won't try and route your WebFormPages.aspx to Controllers.
cause simple crud operations performs easer on webforms
I don't agree with this at all. You have the same problems with either or unless you're going to use SQLdatasource which I don't recommend. nHibernate and EntityFramework provide a nice data access solution for both webforms and mvc
Here is a link to how I achieved Single Sign On, two asp.net projects pointing to the same membership schema.
Why are crud operations easier on webforms? MVC in my opinion is better for crud operations out of the box. Also try jquery controls, as they are better than the built in ASP.NET controls.

Resources