Custom form authentication / Authorization scheme in ASP.net MVC

后端 未结 4 954
陌清茗
陌清茗 2020-12-23 23:44

I am trying to create a custom authentication scheme in ASP.NET MVC using form authentication. The idea that I might have different areas on the site that will be managed -

4条回答
  •  萌比男神i
    2020-12-24 00:37

    okay here you go The Code

    in there you have ActionFilters folder ( AuthAccess.cs) Plugins Folder (security.cs (encrypt/decrypt cookie), SessionHandler.cs (all matters of login)) Controllers folder (BaseController.cs, and exampleController (show you how to use) and the loginTable SQL file.

    i use mysql so you may need to amend, also i use subsonic so my model would come from there and would be in the empty models folder.

    really simple to use will leave it up for a while for you, enjoy

    nope cookie model is here sorry:

    using System;
    
    namespace TestApp.Models
    {
        public class CookieModel
    {
        public string CurrentGuid { get; set; }
        public DateTime LoginTime { get; set; }
        public Int32 UserLevel { get; set; }
        public Int32 LoginID { get; set; }
        public bool isValidLogin { get; set; }
        public string realUserName { get; set; }
        public string emailAddress { get; set; }
    }
    }
    

提交回复
热议问题