Skip to content

Commit

Permalink
docs: specify that custom claims is another nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
loekensgard committed Nov 22, 2024
1 parent 285c42c commit c4ffee4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,24 @@ Log.Logger = new LoggerConfiguration()
.Enrich.WithTenantId()
.Enrich.WithObjectId()
.Enrich.WithAppId()
.Enrich.WithCustomClaim("AnyExistingClaim")
.Enrich.WithCustomClaim("AnyExistingClaim") // Available from Serilog.Enrichers.Claims
// ...other configuration...
.CreateLogger();
```


### Included enrichers

The package includes:
#### Available from Serilog.Enrichers.AzureClaims

* `WithUpn()` - adds `UserPrincipalName` based on the ClaimType `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn`
* `WithDisplayName()` - adds `DisplayName` based on the ClaimType `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name` or `name` or `preferred_username`
* `WithTenantId()` - adds `TenantId` based on the ClaimType `http://schemas.microsoft.com/identity/claims/tenantid` or `tid`
* `WithObjectId()` - adds `ObjectId` based on the ClaimType `http://schemas.microsoft.com/identity/claims/objectidentifier` or `oid`
* `WithAppId()` - adds `AppId` based on the CLaimType `appid` or `azp`

#### Available from Serilog.Enrichers.Claims

* `WithCustomClaim("AnyExistingClaim")` based on the claim you want to extract from the ClaimsPrincipal

## Installing into an ASP.NET Core Web Application
Expand Down

0 comments on commit c4ffee4

Please sign in to comment.