Login and register on ASP.NET MVC 5/6 - asp.net

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

Related

Does it make sense to implement Facebook auth as an ASP.NET Forms auth custom membership provider?

I'm currently developing a web application that will use Facebook as a authentication service. Does it make sense to implement it as an ASP.NET Forms Authentication custom membership provider? While I made my research, I didn't come across any concrete significant advantage of using the Forms Authentication. However, it instinctively seems to me as a good thing to do, because aside from creating a completely custom implementation of authentication using Facebook, I didn't find any extensibility point inside ASP.NET where I could plug in the Facebook auth behavior.
Can you then tell me whether the Forms Authentication is a good idea or not. And if not, is there any other way than completely custom code (I'd like to avoid managing the session cookies, loading the current user, etc. manually).
I'm using ASP.NET MVC 3, Entity Framework and I'd like to avoid the Facebook C# SDK (the extensive use of dynamic types is a bit of a turnoff for me :-) ).
Thanks for any advice.
A simple answer is to use .NET 4.5 oAuth templates, they are incredibly easy to link Facebook up to forms authentication.
http://www.asp.net/vnext/overview/videos/oauth-in-the-default-aspnet-45-templates
However you may struggle to find a decent server if you are planning on releasing immediately. In a couple of months plenty of servers will support .NET 4.5.
The OAuth templates work for both v4.0 and v4.5 so you can publish them onto a server today itself :)

How to implement DotNetOpenAuth as Oauth provider in MVC3 .net?

I have been researching for a while now about how to implement an OAuth provider to secure my web api, but without good results.
For what I've seen so far, apparently there are only three libraries to develop an OAuth provider in .net:
1- DotNetOpenAuth
2- DevDefined
3- OAuth.net from madgex
madgex doesn't have any documentation for providers at all, at leats I haven't found anything, same with DevDefined, well, the last one has some documentation, but it lacks samples.
DotnetOpenAuth I think is the one most developers use, but I'm having a hard time to understand its samples, and documentation is terrible.
Has anybody implemented any of these libraries to write an Oauth PROVIDER, NOT CONSUMER, or anyone knows where I can find a decent documentation fro any of these.
For the record im trying to develop a 3-legged oauth provider.
Can anybody help me out here??
Have you checked out this project template, which although it's MVC 2 should provide some useful ideas for doing it in MVC 3:
http://visualstudiogallery.msdn.microsoft.com/81153747-70d7-477b-b85a-0374e7edabef
Then there is the OAuthServiceProvider sample that comes with DotNetOpenAuth, which is WebForms but the principles are mostly the same.
A good sample of DotNetOpenAuth implementation could be found here Releasing an ASP.NET MVC 3 OpenId StarterKit under Open Source License
Project url: http://mvcopenid.codeplex.com/
It should be good for you to start with.
UPDATE
By the way in ASP.NET MVC 4 third party auth providers it is out of the box.
I have followed the steps mentioned at https://github.com/DotNetOpenAuth/DotNetOpenAuth/wiki/Security-scenarios to implement an OAuth 2.0 authorization service.
I have used the below link to create security certificates:
http://www.jayway.com/2014/09/03/creating-self-signed-certificates-with-makecert-exe-for-development/
Don't forget to change your solution to use the thumbprints from the certificates created by you.
This is the best place to understand the OAuth 2 protocol:
https://www.rfc-editor.org/rfc/rfc6749

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

Some framework on top of ASP.NET MVC for easily create backend part of the site?

Good day!
For PHP framework CodeIgniter exists 'app-framework' BackendPro:
What I mean by this is it provides you with functionality to do all the simple repetitive tasks like authentication, permissions and a basic look and feel for your websites control panel. So using your current PHP and CodeIgniter knowledge you can use BackendPro to built a fully working website quickly since you can concentrate on your application instead of the bits to manage the system.
It helps a lot with building quickly backend of the site (grids for entities, common CRUD interface, login\logout etc you know :)). In fact it is a stub for a backend. Does something similar for ASP.NET MVC exists?
Thanks in advance!
You could be interested in this and following articles by Steve Sanderson:
Scaffold your ASP.NET MVC 3 project with the MvcScaffolding package

OpenID authentication in ASP.NET?

I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?
See Scott Hanselman's post on using DotNetOpenID in ASP.NET. Andrew Arnott's blog is full of samples on using DotNetOpenID with ASP.NET, including ASP.NET MVC.
I recently hooked up DotNetOpenID for the Subtext 2.0 release. It went really smoothly - the code samples included with the DotNetOpenID download are pretty helpful. The one thing I'd recommend is that you just use the library and avoid the ASP.NET control. It uses table based layout (hardcoded) and is pretty difficult to restyle.
DotNetOpenId available at http://code.google.com/p/dotnetopenid
Are there any good tutorials on how to integrate OpenId with an ASP.NET site?
Andrew Arnott's post titled "How to add OpenID to your ASP.NET web site (in C# or VB.NET)"
I'm considering the same thing. On the Open ID site, there's a link 'For Developers' # http://openid.net/developers/ and from there is a link to 'Open Libraries' # http://wiki.openid.net/Libraries and finally from there is one called 'DotNetOpenID' # http://dotnetopenid.googlecode.com/ which is probably what you're looking for.
Good luck.
DotNetNuke may not be a good current example. When we did the integration, DotNetOpenID was not currently supporting OpenID 2.0 spec. I hacked together a fork to get the 2.0 support and have not had a chance to rip it back out for the official DotNetOpenID 2.0 release.
You should check out the DotNetNuke codebase as well, they have been using OpenID for the last several revisions, and you'll find working code for implementing it there.

Resources