https://github.com/nlog/nlog.windowsidentity
NLog extensions for displaying User Windows Identity and target wrapper for user impersonation
https://github.com/nlog/nlog.windowsidentity
authentication csharp dotnet identity nlog nlog-target
Last synced: about 1 year ago
JSON representation
NLog extensions for displaying User Windows Identity and target wrapper for user impersonation
- Host: GitHub
- URL: https://github.com/nlog/nlog.windowsidentity
- Owner: NLog
- License: bsd-3-clause
- Created: 2022-06-05T10:38:49.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T21:26:42.000Z (about 2 years ago)
- Last Synced: 2024-12-06T17:49:16.502Z (over 1 year ago)
- Topics: authentication, csharp, dotnet, identity, nlog, nlog-target
- Language: C#
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NLog.WindowsIdentity
NLog extensions for displaying [User Windows Identity](https://github.com/NLog/NLog/wiki/Windows-Identity-Layout-Renderer) and [target wrapper for user impersonation](https://github.com/NLog/NLog/wiki/ImpersonatingWrapper-target)
[](https://www.nuget.org/packages/NLog.WindowsIdentity)
[](https://ci.appveyor.com/project/nlog/NLog-WindowsIdentity/branch/master)
### How to install
1) Install the package
`Install-Package NLog.WindowsIdentity` or in your csproj:
```xml
```
2) Add to your nlog.config:
```xml
```
Alternative register from code using [fluent configuration API](https://github.com/NLog/NLog/wiki/Fluent-Configuration-API):
```csharp
LogManager.Setup().SetupExtensions(ext => {
ext.RegisterTarget();
ext.RegisterLayoutRenderer();
});
```
### Example of Windows Identity UserName
Example of `NLog.config`-file that outputs username from [Windows Identity](https://github.com/NLog/NLog/wiki/Windows-Identity-Layout-Renderer) :
```xml
```
### Example of Impersonating Windows Identity
Example of `NLog.config`-file that apply [ImpersonatingWrapper](https://github.com/NLog/NLog/wiki/ImpersonatingWrapper-target) :
```xml
```