asp.net - Supplement Windows Authentication Principal with custom properties -


i have webapp @ work uses ad authenticate users. works nicely, ie. adding roles ad long process have contractor takes care of windows network infrastructure. i'd merge roles , permissions (a custom implementation) db principal generated windows authentication.

basically, have following:

protected void application_authorizerequest(object sender, eventargs args) {       if (httpcontext.current != null)     {         string[] roles = null;          if (!userisregisteredlocally(user))             addusertodb(user);         else         {             roles = generaterolesfromappauthorizations(user);             roles.concat(generaterolesfromapppermissions(user));         }           claimsprincipal principal = new genericprincipal(user.identity, roles);            thread.currentprincipal = httpcontext.current.user = principal;     } } 

currently, every single request made server hit db verify if user registered locally (recorded in db). ideally, replace if, checking first time user navigates page (of given "browsing session") , indicate that user has been confirmed exist in db.

is there way me leverage windows authentication principal/identity indicate given user has been persisted or not?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -