Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

How to read claims data from specific function which fire for every request

$
0
0

i am looking for a function which will fire for every request. i can say begin_request in globa.asax and post authenticate functioni guess these two function always fire.

if i am right then tell me from these two function how can i read the my custom data store in claims. please provide code examples.

suppose this below way i am adding multiple claims with my custom data

UserManager<applicationuser> userManager = new UserManager<applicationuser>(new UserStore<applicationuser>(new SecurityContext()));
ClaimsIdentity identity = userManager.CreateIdentity(user, DefaultAuthenticationTypes.ApplicationCookie
var user = userManager.Find(userName, password);
identity.AddClaim(new Claim("Email", user.Email));
identity.AddClaim(new Claim("Email2", user.Email));

thanks


Viewing all articles
Browse latest Browse all 4737

Trending Articles