asp.net mvc 4 - InitializeSimpleMembership filter issue -
i have mvc 4 application out of box simple membership mechanism implemented. have discovered every single time call of controllers in application onactionexecuting method in initializesimplemembershipattribute filter executed! though have commented out initializesimplemembership attribute on account controller so:
[authorize] //[initializesimplemembership] public class accountcontroller : controller {
the filter still getting called! call coming from?
i delete initializesimplemembership file in filters folder default. want initialize once @ start best place global.asax
now keep structure of application_start() method consistent in global.asax, add config file being called method. create new 1 add authconfig. authconfig has default oauth code, makes sense keep authentication methods together.
the method in called registerauth called global.asax once @ start up. add
//local authentication websecurity.initializedatabaseconnection("mydbconnection", "userprofile", "userid", "username", autocreatetables: false);
you have few errors on build resolved removing using statements referencing filters folder (maybe if have resharper) , removing initializesimplemembership attribute (it no longer needed).
in example have autocreatetables false use database project in solution. if use method such code-first may want true
Comments
Post a Comment