Story Details for videos

SecurityGuard - Video for NuGet Package

kahanu
Author:
Version:
Views:
17950
Date Posted:
8/31/2011 8:21:26 PM
Date Updated:
8/31/2011 8:21:26 PM
Rating:
4.67/6 votes
Running Time:
25:18 minutes
Framework:
ASP.NET MVC 3
Platform:
Windows
Programming Language:
C#
Technologies:
SecurityGuard, MvcInstaller, SQL Server
Tags:
ASP.NET MVC, mvc, securityguard, mvcinstaller, sql server
Demo site:
Home Page:
Share:
Downloads: MP4
SecurityGuard is a NuGet package that quickly installs a complete UI for managing the ASP.NET Membership system on your ASP.NET MVC 3 application.

In this video I'll demonstrate how to install the ASP.NET Membership system using my other NuGet package, MvcInstaller, and then install SecurityGuard to actually manage the membership system.  The entire process takes only a few minutes to install and configure.

Comments

  • john
    Posted By: john
    On: 9/28/2011 9:58:46 PM
    Looks Great! This is the easiest one to get up and going that I've seen. Thanks for the video.
  • johnkesinger@yahoo.com
    Posted By: john
    On: 9/28/2011 9:58:46 PM
    This is Great! Easy to get going and full of functionality. Wow...!
  • info@kingwilder.com
    Posted By: King Wilder
    On: 9/29/2011 11:36:01 AM
    @John, I'm glad you like the video and the SecurityGuard Nuget Package. 
  • asdf@dsf.com
    Posted By: asdf
    On: 12/4/2012 10:35:04 AM
    I cant see the vidoes, why?
  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/4/2012 2:13:04 PM
    @asdf - I've heard that if you inside a firewall you may have problems viewing these videos.  If you can find a computer outside the firewall, then it should work without a problem.  I hope that helps.
  • michael.crandall@i3creations.com
    Posted By: cranshark
    On: 12/14/2012 10:29:27 PM

    Great video!  Looking forward to implementing and glad I don't have to code up yet another membership/roles module for my client!

    Thanks!

  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/15/2012 11:32:30 AM
    @cranshark - I'm glad this is helpful to you.  Good luck with it.
  • krzysztof.okun@hotmail.com
    Posted By: krzysiekok
    On: 12/23/2012 3:34:10 PM

    WhenI click onlogout

    To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/23/2012 7:40:31 PM

    @krzysiekok - hi, this is an easy error to fix.  It's covered in the companion article for SecurityGuard, under the "LoginPartial Updates" heading.

    But in short, the error is due to the fact that the LogOff link is still pointing to "Account/LogOff" when it should be pointing to "SGAccount/LogOff".  But there's more than just changing the link reference, that's why you should look at the article for the complete solution.  The LogOff and other features like this now require the AntiForgeryToken, so a form needs to be used to Log off.

    I hope this helps.

  • krzysztof.okun@hotmail.com
    Posted By: krzysiekok
    On: 12/24/2012 4:53:37 AM

    Ohh,

    @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))

    @using (Html.BeginForm("LogOff", "SGAccount", FormMethod.Post, new { id = "logoutForm" }))

    Thanks!

  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/24/2012 11:14:47 AM
    @krzysiekok - I'm glad that helped.
  • branislavk@gmail.com
    Posted By: banek
    On: 12/30/2012 7:56:26 AM

    Nice work!

    How to add custom fields to user's profile e.g. address, city, .... ?

  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/31/2012 12:03:52 PM
    @banek - sorry I have not built any features into SecurityGuard that enables you to modify the Profiles through a web interface.  So for now, you'll need to modify your Profiles the existing way via the web.config.
  • branislavk@gmail.com
    Posted By: banek
    On: 1/1/2013 8:15:26 AM

    Thanks for quick answer!

    I'am considering to create new class "MembershipsProfiles" which will contain "UserId" from "Memberships" as a relationship. The other attributes will be custom data for user: city, address,...

    Please for your advice about that and if it is possible how to implement UI.

    Also, could I use EF for "MembershipsProfiles"?

    Thanks!


  • info@kingwilder.com
    Posted By: King Wilderr
    On: 1/1/2013 2:01:18 PM

    @banek - to create your own custom Profile class you should probably look at these articles.  They give more information on how to manage profiles within your application.

    Jon Galloway's article

    Scott Hanselman's article

    Once you create the class, then you create a new view and actions to use your new custom profile class.

    I hope this helps.

  • jmartinsmith@gmail.com
    Posted By: jayjay
    On: 1/31/2013 8:24:43 PM

    Hi King, excellent video and brilliant security package!

    Got it all working on my mvc 4 application, i had to disable the search function in the Membership\index.cshtml file though was throwing an error saying 'The call is ambiguous' for the Model.SearchTerm

  • info@kingwilder.com
    Posted By: King Wilder
    On: 1/31/2013 9:33:36 PM

    @jayjay - are you using the latest version of SecurityGuard for Mvc 4?  I've tested it on many applications and I don't get that error, but I'll look into it.

    What was the search process you used?  Filter by: View All, Username, Email?

  • alfredo.pasmino@gmail.com
    Posted By: RV
    On: 2/15/2013 4:46:58 PM

    Thanks for the video

    sorry but i have an error when i run MvcInstaller i have the error Could not find a part of the path 

     'c:\documents and settings\apasmino\mis documentos\visual studio 2010\Projects\test\test\App_Data\Reset\'.

    sorry, i am a new user of .net technology

  • info@kingwilder.com
    Posted By: King Wilder
    On: 2/16/2013 11:27:51 AM

    @RV - to fix this, just create a "Reset" folder inside the App_Data folder and the error will go away.  This folder allows you to add your own SQL scripts to reset any database configurations in the event that the installation fails the first time.  There's more information about how to create your SQL scripts in the article for Mvc 3 applciations. I'll make this clearer in the documentation.

    http://www.mvccentral.net/s/44

    Also, this is the SecurityGuard video story, not the MvcInstaller story.  :^)

  • praveen.konduru@gmail.com
    Posted By: praveen
    On: 4/11/2013 4:37:24 PM

    Hi,

    Really nice video. I have installed securityguard and i am trying to use it. But i am getting error at @user.IsinRole("SecurityGuard")

    It complains as object reference being not set.

    Help on this is appreciated.

     
  • info@kingwilder.com
    Posted By: King Wilder
    On: 4/12/2013 12:50:13 PM
    @praveen - what view are you getting this error? Can you show me the complete code where it is used?  Generally this would be in an "if" statement.  Is that how you are using it?
  • praveen.konduru@gmail.com
    Posted By: praveen
    On: 4/12/2013 1:46:55 PM

    Hi,

    Appreciate your response.

    Actually i have sent another question yesterday with some details and write up. I could see that yesterday, any ways that fine.

    Yes you are right, thats with if statment i guess.

    Another question i had is my membership provider is MongoDB custom provider, what is the best way to take advantage of your security guard with custom provider.

    Thanks.

  • info@kingwilder.com
    Posted By: King Wilder
    On: 4/12/2013 4:49:24 PM

    @praveen - as I mentioned in my other response in the SecurityGuard post, SecurityGuard was not built to be used with MondoDb or any other "no sql" provider.  At the moment it's meant to be used with SQL Server and the ASP.NET Membership system only.

    You could try to have two databases, one as SQL Server with the Membership system, and the other as MongoDB.  You would need two connection strings in your web.config.  You could see if that would work, otherwise I don't have any suggestions.

  • shardie@kindreds.net
    Posted By: kinstephen
    On: 5/28/2013 6:17:01 PM

    Can you use SecurityGuard without it's LogOn screens? I would prefer to implement my own Log on and authentication routines. I'm only interested in the user management aspect of SecurityGuard.

    Also, do you have to use a SecurityGuard role? Can I create my own?

  • info@kingwilder.com
    Posted By: King Wilder
    On: 5/28/2013 6:22:23 PM

    @kinstephen - you have the complete source code, so you can modify it all you want.  The actual source code is also up on github, if you go to the other SecurityGuard for MVC4 article, you'll see the link to the repository.

    The only reason to use the SecurityGuard Role is to be able to differentiate who gets to see that navigation item to the SecurityGuard Dashboard.  You can do anything else that you want, this was just an easy out-of-the-box way of saying, "this Role is the only one that gets to view the SecurityGuard Dashboard."

    I hope that answers your questions.

  • mghamry@icfi.com
    Posted By: mjg
    On: 9/5/2013 3:44:22 PM
    Hi, I don't see the /MailerTemplates/ResetPassword.html page in the solution, although it's being pointed to in the web.config. Do you have these files somewhere to be downloaded?
  • mghamry@icfi.com
    Posted By: mjg
    On: 9/5/2013 3:44:22 PM
    Also, in your installer.config you're including the database tags. How can I point to a connection string included in the web.config instead of adding another connection string to the same database?
  • info@kingwilder.com
    Posted By: King Wilder
    On: 9/5/2013 4:49:45 PM

    @mjg - the mailer templates should be there. If you don't see them, you can uninstall and reinstall to get them.

  • info@kingwilder.com
    Posted By: King Wilder
    On: 9/5/2013 4:49:45 PM
    @mjg - regarding your second question, this is an MvcInstaller question, not to do with SecurityGuard. I'm not sure I understand what you are asking.
  • abuhamzah09@gmail.com
    Posted By: Abu Hamzah
    On: 9/16/2013 5:01:30 PM

    i am unable to view the youtube what do i need to do to view? also i have searched on youtube and did not find any video associated to you or SGA

  • info@kingwilder.com
    Posted By: King Wilder
    On: 9/16/2013 6:53:04 PM

    @Abu Hamzah - sorry you can't see the video, but first of all it isn't a YouTube video, so you won't be able to find it on YouTube. 

    I've heard from other users that if you are behind a firewall you will have problems seeing the video.  Please find a connection outside the firewall and you should have no problems.

  • abuhamzah99@gmail.com
    Posted By: Abu Hamzah
    On: 9/16/2013 9:40:54 PM

    @King Wilder: I able to watch finally and I have noticed that you are not using the new Universal Provider? are you working on it? thanks for the video.

  • info@kingwilder.com
    Posted By: King Wilder
    On: 9/17/2013 1:58:56 AM

    @Abu Hamzah - if you are referring to the new SimpleMembership providers, then no, I have not incorporated this new providers into SecurityGuard.  I am investigating whether I can easily integrate it into SecurityGuard, but I am working on other projects that have priority over SecurityGuard.

  • joe@data-flow.co.uk
    Posted By: dataflowjoe
    On: 12/15/2013 10:08:01 AM

    Hey King Wilder,

    Love this package you have done a great service to the wider development community. I'm relatively new to MVC and was wondering if can you let me know how a the package is implemented in locking a view. I've looked at the tutorial on authentication in the MVC music store but it uses a different methodology. Can you give me a simple example of how to lock down an existing view using your securityguard. If you have a tutorial on implementation then point me to that if it is easier. Thanks again!

  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/16/2013 12:50:11 PM

    @dataflowjoe - your wording is a bit confusing to me.  When you refer to "locking" do you mean when a user gets their account locked by too many invalid login attempts?  If not then can you explain?

    If you are then the locking mechanism is all ASP.NET Membership, SecurityGuard just creates an easy way to manage the feature already built into the membership system.  SecurityGuard does not use it's own locking mechanism to lock a user out of their account.

    But it sounds like you are asking something different that locking a user out of the their account.  If you are trying to prevent someone from seeing certain views, then that's an MVC implementation and not a SecurityGuard function.  You can just set certain controllers, or just actions in a controller to a specific role, then you can set permissions so only logged on users in those roles will be able to see those views.

    If this is what you are asking about, then it's easiest if you use a NuGet package like MvcSiteMapProvider.  It allows you to add a menu to your application and use security trimming which lets you assign Roles to specific actions on controllers.  When users log on, it detects which Role they belong to and then it will only display those menu items that they are permitted to see.

    I hope this helps.

  • joe@data-flow.co.uk
    Posted By: dataflowjoe
    On: 12/17/2013 4:37:15 AM

    I must say you are so totally dedicated in helping your fellow developers. May you reap a lot of blessing for your kindness!
    Yes that was a bit confusing, I meant to say... prevent a user from seeing a view. I actually noticed after I wrote that post, you do have an example of useage, which I have now implemented. Just one another thing how can I set the 're-direct to page' after the user succesfully logs in?

    Top Man, I can see why you have King in your name!! :-)

  • joe@data-flow.co.uk
    Posted By: dataflowjoe
    On: 12/17/2013 4:59:59 AM

    Hi King Wilder, I just noticed that when one clicks on the users username link, it is looking for /SGAccount/Manage and it comes up with error page 'Resource not found' is this 'manage' view missing from the installer build? Thanks!

  • info@kingwilder.com
    Posted By: King Wilder
    On: 12/17/2013 11:10:13 AM

    @dataflowjoe - thank you for your kind words.

    1. Redirect - to redirect elsewhere, go into the SGAccount controller in the Login action... you can set the redirect there.  By the way, this is a normal MVC operation, not something specific to SecurityGuard.  :^)
    2. Manage action - this is something talked about in the SecurityGuard companion article (there's a link at the top of this page with a link to the article).  Essentially it is part of the default MVC Visual Studio template that you choose when you are creating a new MVC project.  They include this Manage action that allows you to change your password and a couple other things.  I did not build SecurityGuard to use this because at the time, this version of the template did not have this command, and then after this new VS template included the Manage action, I decided not to use it since it didn't bring any new functionality to the application.  I would remove it and use the commands in SecurityGuard (like Change Password).  SecurityGuard has all the commands available to you that are included in the ASP.NET Membership system.  Also most developers remove the Manage link because they implement that functionality differently in their application, so I did not want to confuse the issue.  I hope this helps.
  • joe@data-flow.co.uk
    Posted By: dataflowjoe
    On: 12/17/2013 1:16:19 PM
    To the King... I'm new to MVC, but evrything you have said makes total sense and has pointed me in the right direction. So once again a huge thank you for your time and patience!  
  • yasir.wafeeq@gmail.com
    Posted By: wafeeq
    On: 1/15/2014 12:55:47 PM

    Hello,

    I was trying to implement this video same as done but I get error everytime when I try to Install it and the error is,

    Could not find a part of the path 'D:\WebTurorials\MvcApplication6\MvcApplication6\App_Data\Reset'.

  • yasir.wafeeq@gmail.com
    Posted By: wafeeq
    On: 1/15/2014 12:57:47 PM
    My problem is solved. This problem has already been discussed in above comments. 
  • yasir.wafeeq@gmail.com
    Posted By: wafeeq
    On: 1/22/2014 3:24:54 PM

    Hello, 

    Forgot password does not send password to email address. Is there any modification required?

  • jbjohnson@pacbell.net
    Posted By: JimJ
    On: 6/15/2014 4:04:35 PM

    Hi King,

    Thanks for the work on SecurityGuard.  Following your video, I got it to work in MVC4, preliminarily.

    I'm doing a conversion and so I have an existing DB I would like to add SG to.  Is there an automagic way to do that?  Or do I need to recreate the SG files in the existing DB and adjust the webconfig provider pointers accordingly?

    Any pointers on this would be appreciated.  Thanks!


  • carla.mahlberg@gmail.com
    Posted By: mahlbergc
    On: 1/12/2015 7:40:10 AM

    Thank you for this video, but can you recommend a tutorial on how to implement forgot password?  I have created the validations and the html, now I am moving into the controller httppost piece and I am unsure what to add.

    Thanks.

  • info@kingwilder.com
    Posted By: King Wilder
    On: 1/12/2015 8:15:02 AM

    @mahlbergc - The Forgot Password feature is built-in!  It's attached to the login view.  All you need to do is click that link and it will take you to the Forgot Password view.  You don't need to do anything for this to work.

    The only thing you need to do manually is update the web.config SMTP settings with your email server settings that will send out the emails from this feature.

    I hope this helps.

  • amitkumar1091@gmail.com
    Posted By: Amit
    On: 8/19/2015 2:14:46 AM

    Hi,

         Nice demo.    

    Can I download this demo project . If I can download it so please provide link for download.

  • amitkumar1091@gmail.com
    Posted By: Amit
    On: 8/19/2015 2:14:46 AM

    Hi,

         Nice demo.    

    Can I download this demo project . If I can download it so please provide link for download.

  • amitkumar1091@gmail.com
    Posted By: Amit
    On: 8/19/2015 2:14:46 AM

    Hi,

         Nice demo.    

    Can I download this demo project . If I can download it so please provide link for download.

  • info@kingwilder.com
    Posted By: King Wilder
    On: 8/19/2015 8:19:16 AM
    @Amit - hi, this isn't a demo application, and the video isn't focusing on the application that I'm applying SecurityGuard to.  It's a demonstration of the SecurityGuard NuGet package that you can use in your ASP.NET MVC application.  If you want to try it, create an MVC application, then get the NuGet package.  :^)

 

User Name:
(Required)
Email:
(Required)