MVC5 Identity Stuff
-
I've been trying all weekend to get my head wrapped around the (self-imagined?) quagmire that is MVC5 Identity. I have created/deleted my project about a dozen times attempting to implement an email confirmation setup. I'm tired of doing all that crap over and over again. Is there a MVC template or nuget package available that already has most/all of the various identity features implemented? One last thing - When I create a MVC5 app at home, the ManageViewModel is missing. When I do it at work, I see the Manage ViewModel. Could that have something to do with the patch level on Visual studio (I just did a fresh Win7 install at home)?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
I've been trying all weekend to get my head wrapped around the (self-imagined?) quagmire that is MVC5 Identity. I have created/deleted my project about a dozen times attempting to implement an email confirmation setup. I'm tired of doing all that crap over and over again. Is there a MVC template or nuget package available that already has most/all of the various identity features implemented? One last thing - When I create a MVC5 app at home, the ManageViewModel is missing. When I do it at work, I see the Manage ViewModel. Could that have something to do with the patch level on Visual studio (I just did a fresh Win7 install at home)?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013Not the anwser your looking for. But are you talking about the OWIN Identity? I'm on my 3rd MVC project now, and I'm happy with it so far. I dumped OWIN, stripped it out and replaced it with my own stuff. The OWIN was overkill for me. I didn't need all those features, and it was too time consuming to setup for me. Plus I could not modify it, no source code for it. And it kept changing too fast to keep pace with. I'm running 3 sets of credentials, customer, owner and anonymous or non-registered customer. I made a DLL called security, and just used PWDTK for the password, and wrote separate attributes for security that I use in the controller. So the Attr [AdminSecurityCheck] runs each time the controller runs the page, and does all the checking, programs the HttpContext.CurrentUser, and sets Session Vars. It only lives for the lifecycle of the page. I have 3 of these now, and will just add more features to it later. If the identity fails, it routes the user to the login page for that controller. It also loads the complete identity of the user with there avatar image, everything I need to identify or use the identity, such as email address.
[AdminSecurityCheck]
public ActionResult OrderProcessing()
{}
I have no clue what others are doing. I did ask a similar question 3 months ago and heard the sound of crickets on it. I sort of reversed engineered OWIN and created my own stuff, but there's too much code to post, and I'm not sure if your really interested in what I did. The 2nd question, did you create a MVC project, I did what you did like 3 times to get that option to show. I found even if you create a DLL for MVC, you have to create a MVC project, and strip out what you don't need.
-
Not the anwser your looking for. But are you talking about the OWIN Identity? I'm on my 3rd MVC project now, and I'm happy with it so far. I dumped OWIN, stripped it out and replaced it with my own stuff. The OWIN was overkill for me. I didn't need all those features, and it was too time consuming to setup for me. Plus I could not modify it, no source code for it. And it kept changing too fast to keep pace with. I'm running 3 sets of credentials, customer, owner and anonymous or non-registered customer. I made a DLL called security, and just used PWDTK for the password, and wrote separate attributes for security that I use in the controller. So the Attr [AdminSecurityCheck] runs each time the controller runs the page, and does all the checking, programs the HttpContext.CurrentUser, and sets Session Vars. It only lives for the lifecycle of the page. I have 3 of these now, and will just add more features to it later. If the identity fails, it routes the user to the login page for that controller. It also loads the complete identity of the user with there avatar image, everything I need to identify or use the identity, such as email address.
[AdminSecurityCheck]
public ActionResult OrderProcessing()
{}
I have no clue what others are doing. I did ask a similar question 3 months ago and heard the sound of crickets on it. I sort of reversed engineered OWIN and created my own stuff, but there's too much code to post, and I'm not sure if your really interested in what I did. The 2nd question, did you create a MVC project, I did what you did like 3 times to get that option to show. I found even if you create a DLL for MVC, you have to create a MVC project, and strip out what you don't need.
Nice reply, +5 ...
hi
-
Not the anwser your looking for. But are you talking about the OWIN Identity? I'm on my 3rd MVC project now, and I'm happy with it so far. I dumped OWIN, stripped it out and replaced it with my own stuff. The OWIN was overkill for me. I didn't need all those features, and it was too time consuming to setup for me. Plus I could not modify it, no source code for it. And it kept changing too fast to keep pace with. I'm running 3 sets of credentials, customer, owner and anonymous or non-registered customer. I made a DLL called security, and just used PWDTK for the password, and wrote separate attributes for security that I use in the controller. So the Attr [AdminSecurityCheck] runs each time the controller runs the page, and does all the checking, programs the HttpContext.CurrentUser, and sets Session Vars. It only lives for the lifecycle of the page. I have 3 of these now, and will just add more features to it later. If the identity fails, it routes the user to the login page for that controller. It also loads the complete identity of the user with there avatar image, everything I need to identify or use the identity, such as email address.
[AdminSecurityCheck]
public ActionResult OrderProcessing()
{}
I have no clue what others are doing. I did ask a similar question 3 months ago and heard the sound of crickets on it. I sort of reversed engineered OWIN and created my own stuff, but there's too much code to post, and I'm not sure if your really interested in what I did. The 2nd question, did you create a MVC project, I did what you did like 3 times to get that option to show. I found even if you create a DLL for MVC, you have to create a MVC project, and strip out what you don't need.
Last night, I updated VS2013 to sp5, and the generated MVC5 project is somewhat different in terms of the Identity stuff. It now defaults to using the email address as the user id, and actually includes stubbed out code for confirmation emails. The problem is that if you uncomment the code, it doesn't send the email. They also assume you should use something called "sendgrid" to handle the email. I wrote my own email sending functions, but had to come to work before I could try it out. This whole MVC thing is kinda nuts for me. I don't think I like it much. Maybe its the fact that I'm not comfortable with sh|t happening without me having actually written said sh|t.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Last night, I updated VS2013 to sp5, and the generated MVC5 project is somewhat different in terms of the Identity stuff. It now defaults to using the email address as the user id, and actually includes stubbed out code for confirmation emails. The problem is that if you uncomment the code, it doesn't send the email. They also assume you should use something called "sendgrid" to handle the email. I wrote my own email sending functions, but had to come to work before I could try it out. This whole MVC thing is kinda nuts for me. I don't think I like it much. Maybe its the fact that I'm not comfortable with sh|t happening without me having actually written said sh|t.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013Identity is nothing to do with MVC. The inclusion of security into default project templates has come from the maturing of Visual Studio. If you want to work with pure MVC then simply select an empty MVC project and nothing is written for you, it's all for you to implement yourself.
-
Identity is nothing to do with MVC. The inclusion of security into default project templates has come from the maturing of Visual Studio. If you want to work with pure MVC then simply select an empty MVC project and nothing is written for you, it's all for you to implement yourself.
I realize that. MVC is still nuts.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
I realize that. MVC is still nuts.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 20133 months ago I would of agreed with you. But now I'm starting to really like MVC, and there's no turning back for me now. I haven't saved any time yet, because I'm still learning it. But I can see how much faster it is to create projects than web forms. When you get into using web services to load data, you'll see the benefits of the controller and view. So there is a JsonResult, sort of like a ActionResult which is really cool. It packages your model as Json, then your client script just unpacks it as data. Or writing Javascript, and ID's of the elements are consistent with the model you create. As for the Identity; I remember having to go into the App_Start folder and programming the IdentityConfig.cs to get all the features to work. I gave it a spin for a week and then I dumped it. It was just stupid. The Identity package has nothing to do with MVC. It's just a over complicated package that will always put up roadblocks later in development. Don't let that Identity package give you a bad impression of MVC.
-
Nice reply, +5 ...
hi
-
3 months ago I would of agreed with you. But now I'm starting to really like MVC, and there's no turning back for me now. I haven't saved any time yet, because I'm still learning it. But I can see how much faster it is to create projects than web forms. When you get into using web services to load data, you'll see the benefits of the controller and view. So there is a JsonResult, sort of like a ActionResult which is really cool. It packages your model as Json, then your client script just unpacks it as data. Or writing Javascript, and ID's of the elements are consistent with the model you create. As for the Identity; I remember having to go into the App_Start folder and programming the IdentityConfig.cs to get all the features to work. I gave it a spin for a week and then I dumped it. It was just stupid. The Identity package has nothing to do with MVC. It's just a over complicated package that will always put up roadblocks later in development. Don't let that Identity package give you a bad impression of MVC.
Well, I'm not interested enough to roll my own, so I use as little of the identity stuff as I need to register/login users. Everything else is wasted on me. I've always had a problem with web development because of its stateless nature. Just not a fan. In any case, I think I have the register/login stuff done, and it's time to move on to the rest of the app.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Well, I'm not interested enough to roll my own, so I use as little of the identity stuff as I need to register/login users. Everything else is wasted on me. I've always had a problem with web development because of its stateless nature. Just not a fan. In any case, I think I have the register/login stuff done, and it's time to move on to the rest of the app.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013