I am using mvc 5 with id 2.0. I want to use custom requirement values ββfor the application, but I get a null value. Where am I doing wrong? Please help me
Updated Code
Account Controller Login Code
if (!string.IsNullOrEmpty(model.UserName) && !string.IsNullOrEmpty(model.Password)) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var result = SignInManager.PasswordSignIn(model.UserName, model.Password, model.RememberMe, shouldLockout: false); //Generate verification token Dictionary<string, string> acceccToken = null; if (SignInStatus.Success == 0) { var userDeatails = FindUser(model.UserName, model.Password).Result; if (userDeatails != null) acceccToken = GetTokenDictionary(model.UserName, model.Password, userDeatails.Id); } if (model.RememberMe) { HttpCookie userid = new HttpCookie("rembemberTrue", "1"); userid.Expires.AddDays(1); Response.Cookies.Add(userid); } else { HttpCookie userid = new HttpCookie("rembemberTrue", "0"); userid.Expires.AddDays(1); Response.Cookies.Add(userid); }
Starup.Auth.cs
public void ConfigureAuth(IAppBuilder app) {
...........
another controller
Here I am trying to get these claim values, but it shows null
var identity = (ClaimsIdentity)User.Identity; var res= identity.FindFirst("urn:Custom:MasterUniqueId");
res is null
c # asp.net-mvc-5 claims-based-identity asp.net-identity owin
Neeraj Sharma May 14 '16 at 12:53 on 2016-05-14 12:53
source share