UserId for auditor

Posts   
 
    
Posts: 18
Joined: 21-Mar-2011
# Posted on: 19-Apr-2011 12:27:10   

Hello, i am using Dependency Injection for auditing changes in entities. It runs on server. I faced question how to get userId of person, who made changes to entity. As my audit library works on server, i think i can not take current principal. I read some threads about this topic but i would like to here your recommendation about way of carrying userId.

Thanks

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 19-Apr-2011 21:47:23   

We need some more information about how your application is being used - ie is it being called by a web application ? Is the web app on the same server or a different one ? How are the users authenticated etc?

If you can give us some more information we can try and point you in the right direction.

Thanks

Matt

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Apr-2011 05:41:58   

Also, Auditor in LLBLGen are plumbing classes that let you define your own auditing code. That means you can get the UserId in the best way you perform your authentication.

See the Auditing exmple (available in download section in LLBLGen site), that example just pick up the user from the session. Maybe you want to use IPrincipal, or you could set the userId to a custom property on your Auditor class, whatever you want/need. It's up to you simple_smile

David Elizondo | LLBLGen Support Team
Posts: 18
Joined: 21-Mar-2011
# Posted on: 21-Apr-2011 08:05:00   

Thanks.