I'm sure it's a requirement many developers have faced before: business needs an audit trail to know who is performing actions in their system.
Regardless of how you choose store the audited information, the core of this problem is how to identify the current user.
I want to write components, ranging from small domain model classes to service components, all which can safely be called from any of the following host applications:
- A Windows desktop application.
- An ASP.NET website hosted in IIS.
- A WCF service hosted in IIS.
- A WCF service hosted in a Windows service.
Given the range of technologies, the various authentication models and having to account for the concept of an "anonymous" user, I'm not clear on a strategy to use to get the identity of whoever invoked my component in a centralised fashion.
Can any of you smart folk suggest an approach to tackle this?