Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Adolfok3 committed Apr 27, 2024
1 parent 5fb81b7 commit 75f782d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,18 @@ services.AddHttpClient("TargetApi")
```csharp
public class MyCustomInterceptor : IAuthorizationInterceptor
{
public async Task<AuthorizationHeaders?> GetHeadersAsync()
public async Task<AuthorizationHeaders?> GetHeadersAsync(string name)
{
//Do something and return the headers if exists in this context
}

public async Task<AuthorizationHeaders?> UpdateHeadersAsync(AuthorizationHeaders? expiredHeaders, AuthorizationHeaders? newHeaders)
public async Task<AuthorizationHeaders?> UpdateHeadersAsync(string name, AuthorizationHeaders? expiredHeaders, AuthorizationHeaders? newHeaders)
{
//Do something with expired headers if necessary and update with newHeaders
}
}
```

With this configuration, the Authorization Interceptor will create a sequence of: `MemoryCache > DistributedCache > MyCustomInterceptor > AuthenticationHandler > DistributedCache > MyCustomInterceptor > MemoryCache`.

> The 'name' parameter refers to the name of the configured HttpClient. With this parameter you can differentiate between multiple httpclients configured using the same interceptor.

0 comments on commit 75f782d

Please sign in to comment.