GOOD tutorial(s) for learning the ASP.Net security/authentication framework - asp.net

Through a lot of sticking my head in the sand, reinventing the wheel and general stubbornness, I've managed to go all this time (years) avoiding learning the built-in ASP.Net support for web application authentication, users and roles. Part of the reason is that rolling my own originally seemed like less work than getting my head around all the different layers of optional abstraction provided by the ASP.Net security framework and as such I came up with a nice library that worked fine for me.
I'm now trying to go back to using as much of the built in functionality of ASP.Net (MVC2/3, not WebForms) as possible, as I've found that the more non-standard functionality you build into an application, the harder it is for other developers to pick up your code and work with it.
The web is thick with half-tutorials, badly explained articles and information that excludes important beneath-the-hood information about the ASP.Net security framework.
Are there any good tutorials that rip the lid off ASP.Net security and show you how to use it and how it all works without trying to push you through wizards and specific provider models without understanding all of the options and their pros and cons?

This is a 18 part series articles from Scott Mitchell.
It's a very deep explanation of all the features that regards Authentication, Authorization and Membership providers in asp.net. I did never found a better source on this from the same author.

MSDN is the best for ripping the lid off: http://msdn.microsoft.com/en-us/library/ff647070.aspx

Related

Migrating from asp.net webforms, do you recommend mvc or web api?

I know I´m late for this party.
Currently migrating form asp.net webforms to newer coding technologies and paradigms. Barely got started with asp.net mvc and now I´m noticing all this fuzz about mvc vs webapi. I'm an oldschool programmer and don´t really feel confortable with the "use both" approach, if there´s no need to. Please consider this:
My web projects focus on dynamic dashboards/admin sites to manage CRUD operations for tons of SQL records, generate reports on demand, statistics, etc.
No static websites at all (like info sites, portfolios and such).
Performance over UI design. Actually bootstrap basic UI is enough for me.
Pure ADO over entity framework, whenever possible.
Any tip or guidence on what I should choose would be very much appreciated.
* Edit/Closing *
Hi again and thank you for your feedback.
After a lot of reading and experimentation I´ve decided to give a real hard tryout to asp.net webapi + angular.js, mostly because I want to leave the door open for multiplatform/device usage (not web only).
Also, I found a very interesting article/tutorial in https://superdevelopment.com/2013/12/16/building-rich-web-apps-jquery-vs-angular-js/
It may be a little old but I think it´s worth reading, specially this extract right here: "Angular.js and WebAPI is a new way to build rich interactive web applications that fully embraces what can be done with a Web browser, JavaScript and C# rather than relying on out-dated paradigms that complicate the process for all but simple use cases. If your users and clients are expecting an application in a web browser that behaves like a native app on their desktop or smart phone, then jQuery + ASP.NET MVC is not the most straightforward way to build it."
Anyway, thanks to all and I hope this info helps others in the programming community.
if your application is going to be consumed various type of devices then prefer web api.
if your application is like website or portal where user has very little interaction then go for MVC

Which flavour of .net is better for E-Commerce Website

I am new to ASP.NET. and having big job converting ASP E-commerce website (It has lots of things those are customised like business logic, having own Database structure) to ASP.NET. Here, I am getting confused with some issues... I am writing this here after having lots of thinking of these issues but still they are unsolved. I have estimated 8-10 weeks for these job, and this is 2nd week is going on...
Is it better to create E-Commerce website from scratch or Modify current available Solutions?
If Creating new one, than which one is better ? ASP.NET Web Forms using N-tier Structure or MVC (Having no experience in this)
Is it true that MVC makes website access faster than Web Forms does?
Or its better to take some time, learn MVC and go ahead?
I think, may be there are questions like these, than please redirect me on that.
Thanks.
If you know web forms, use web forms. Web forms is still a good technology with great third-party controls. There's no reason to use an unfamiliar technology.
I looked up the EF mentioned and came across http://efvote.wufoo.com/forms/z7x3p9/
Apparently there is a list close to 1000 experts including MVPs that state that EF is no longer a viable option unless MS invests in its improvement.

How to start a new ASP.NET MVC site?

I'm a experienced .NET developer, but I havent done much webdevelopment and particularly not a new site from scratch.
Now am I thinking of building a site for one of my hobbies. I realize that much of the functionality I need has already been bulit and hopefully released as opensource. My wish is to find a skelletton for my site with the basic functionality to bulid upon. That will leave the specific and fun parts to me....
I wishlist:
- One logon for the site.
- User profiles.
- Possibility for users to contribute with articles, pictures, links etc.
- Leave comments for articles.
- Generate feeds.
- Build the site using ASP.NET MVC
Can anyone point me in the right direction? Where do I start?
I hesitated writing this answer because it might come across as flippent or deliberately unhelpful.
However, I cannot recommend highly enough the tutorials and examples on the MVC site; especially the NerdDinner example app and walkthrough (not sure if it's been updated for MVC2 though).
As developer for developers ;) check this http://kigg.codeplex.com/ I think it's exactly what you need. Live sample here dotnetshoutout.com
Enjoy :)
Hi Malcolm what you need has been implemented many times. If you need to start from scratch for the learning experience I would recommend the ASP.Net MVC Membership Starter Kit (http://mvcmembership.codeplex.com/) it would handle user accounts and profiles for you (read up on ASP.Net membership if you are unfamiliar with it).
If you don't need to start from scratch I would recommend looking at a CMS or blogging system depending on your specific requirements as there is no point in reinventing the wheel unless you really have to or want to learn.
Edit
Have a look here:
http://www.microsoft.com/web/gallery/Categories.aspx?category=Blogs
and
http://www.microsoft.com/web/gallery/Categories.aspx?category=ContentMgmt&appid=BlogEngineNET
I am not up to date with MVC blog engines but I know there isn't too many CMS's around that would compete with more mature ASP.Net alternatives.
I hope this is helpful.
Thanks,
B
check out http://www.orchardproject.net/. But you may find some liter alternatives for your specific needs. Or you can possibly combine a couple of codeplex projects to get to where you want to be.
As stated above I would recommend going through the nerd dinner tutorial again. Also the nerd dinner code hosted at codeplex has been updated to Asp.net MVC 2.0, and is a great reference to many of the new features. Burt mentioned the MVC Membership Starter kit (http://mvcmembership.codeplex.com/), I have personally tinkered with this, and it saves hours upon hours of time by automagically implementing authentication and role management built on a standardized db schema easily generated by a tool found in the framework 2.0 files somewhere.

Is there a drawback of using ASP.NET Dynamic Data for a data driven website?

I watched a little introduction into ASP.NET Dynamic Data, and I noticed this option to create a data driven website for the first time. I have a database with a few tables, just created a Dynamic Data application out of my database and well... my application with a lot of nicely looking web pages, navigation between them and all kinds of CRUD operations was finished after 3 minutes.
OK, seriously, it isn't finished of course. There is a lot of custom logic to introduce, design to change, and also pages or relationships to remove I don't want actually to see in the web application.
But now I am wondering if ASP.NET Dynamic Data is at least a viable starting point or do I better start from scratch and create page by page? I could imagine that it might be useful to create a quick database maintenance web interface but is it good for a very customized web application? Is it in the end more complicated to modify the scaffold than building up everything from the ground?
I'm very interested in your experiences or recommendations regarding Dynamic Data! Thanks in advance!
I could never wrap my ahead around it enough to get any use out of it. At first, I thought this was Microsoft's answer to Ruby on Rails, and I was looking for the same benefit. I don't it comes close to having the same benefits. When I then compare it to a CMS (DotNetNuke, Sharepoint, Drupal, etc) it then looks really underpowered. Compared to ASP.NET MVC, it seems like going the wrong way from basic ASP.NET (MVC is removing bad abstractions from ASP.NET, while DD is adding even more abstractions).
Personally I'd rather build something from scratch in ASP.NET MVC, though my day job is regular ASP.NET. I'm also learning Drupal as I haven't found the sweet spot with ASP.NET based CMSes. One thing at at a jobsite you're going to want to use technologies everyone else knows. So I think that limits where knowing Dynamic Data is generally useful, as basically any legacy application won't be using it and you're unlikely to find a team with existing ASP.NET Dynamic Data experience.
The quick scaffolding is spiffy but at the end of the day I don't think it will make web development easier.
I very like ASP.NET Dynamic Data as it is a fast way for creating data driven applications. Customization is not a complicated task.
I wrote a corporate website with this technology from the scratch - it takes appr. 2 months for all. So my point of view that this is a good starting point for web applications development.
if your archetecture resembles ASP.NET Dynamic Data or DotNetNuke or some other starter kit, go for it, if
application is small to medium sized
you do not have strict deadlines
you are learning the technology.
otherwise or when you will be skilled in particular technology, you will prefer yourself working from scratch as it gives you more freedom and space for the implementation of ideas.
For e.g, one reason for the breakthrough for Asp.Net MVC had was many .Net developers wanted freedom over the development / architecture / flow and rendering (HTML) of the product they were building. Asp.Net WebForms does provide solid and vast grounds for swift development and templates but developers had to go according to the architecture. This freedom is available under MVC and developers can make use of nearly all Libraries and skill set available and go their own way.
one successful sample is Stackoverflow.com itself
hope this helps

What are other ASP.NET web applications that are as well done as StackOverflow?

It's my understanding that StackOverflow (SO) was built using ASP.NET. What surprised me is it's so well designed and well implemented. Without knowing much about the internals of SO, here are my observations and educated guesses:
SO appears to be highly scalable.
URLs in SO are friendly.
It appears that SO does not contain a bunch of controls as most ASP.NET apps I've seen.
Judiciously and effectively use of Ajax requests, opacity animation, etc. Viewing source tells me SO is using jQuery.
SO runs on all major browsers (that I've used and this list includes IE, FF, Chrome, Opera).
Edit: 6. Comet-like feature: As you type your answer, if there is any other answer posted, you get the notification. If you choose to load it, of course only a partial page refresh is done and your answer remain intact. Have yet to see this in any other ASP.NET app.
So my questions:
What are other ASP.NET web
applications that are as well done
as StackOverflow and what are their
features that you like?
Can you share
about some more details about SO,
for example is SO built using
ASP.NET MVC or something else?
SO is built using ASP.NET MVC as explained by Jeff Atwood and his team in this podcast organised by Scott Hanselman
Listening to the podcast would be worthwhile.
One surprising element about SO which was revealed in the podcast is that SO runs on a single server (IIS & SQL Server). I was surprised by this.
ASP.NET Forms allows developers to build UIs in much the same way as .NET Windows Forms.
The whole idea was that a developer that knew how to build a 'Fat Client' Windows form could transfer those skills to ASP.NET forms. ASP.NET forms even allowed developers to pretty much put code on the same set of control events. The developer was sheilded from having to have any knowledge of HTML, HTTP, Javascript etc.
Unfortunately this resulted in large POSTs containing monster viewstate being generated frequently and hence a poor user experience. This is what has given ASP.NET a bad rep. In reality its the original ASP.NET Forms that should have the bad rep.
ASP.NET MVC, amoungst other things, embraces the nature of HTTP rather than trying to hide it. AJAX and JQuery are also features of MVC which add to the overall result being better.
That said having a great tool is useless without great vision, design and skill, the SO team clearly have those in abundance.
Orkut.com - A social networking site by google uses ASP.NET
SO was build with ASP.NET MVC. Jeff hired good developers, had a good vision, and ran his screens through a real designer.
Myspace.com uses ASP.net, which proves the scalability of the platform in general. You can also learn a lot about stackoverflow itself from reading the stackoverflow blog and listening to the stackoverflow podcasts.
Many of the things you point out about are actually due to the use of ASP.NET MVC. Pretty URLs come out of the box, non-standard controls, well nothing comes out of the box with MVC so you have to reinvent everything :), and finally the AJAX is pretty much a requirement for ASP.NET MVC if you want to do anything intelligent with it.
ASP.NET MVC alone does not account for the things which makes StackOverflow truly successful that's all down to the idea, execution, and the fact that Jeff and Joel combined garners a huge following on the net.
You can also learn quite a lot about the development, planning(!), etc in the two HanselMinutes podcasts on SO:
StackOverflow uses ASP.NET MVC - Jeff Atwood and his technical team
Behind the Scenes - StackOverflow and Jeff Atwood - Part 2
Available in numerous audio formats, as well as transcribed.
ASP.NET creates websites limited only by the talent of the developers.
The same can be said for virtually any framework.
That said, Windows Server/IIS/.NET is a hugely scalable concept, as we serve far far more traffic than SO on a ASP.NET site (Then again, we have 32 servers).
As mentioned in one of the answers here, myspace.com uses ASP.NET (as far as I know it was written in ColdFusion and used BlueDragon for .NET).
One other site is plentyoffish.com (60M hits per day).
If you want to read more about scalability see http://highscalability.com

Resources