Skip to content

Commit 12b56a2

Browse files
authored
Merge pull request #10 from dozer75/add-additional-headers-support
Add additional headers support
2 parents 5fb6709 + f23ea75 commit 12b56a2

37 files changed

+414
-227
lines changed

.github/workflows/master-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
steps:
2323
- name: Checkout source
2424
uses: actions/checkout@v4
25-
- name: Setup .NET 8.0.x
25+
- name: Setup .NET 9.0.x
2626
uses: actions/setup-dotnet@v4
2727
with:
28-
dotnet-version: '8.0.x'
28+
dotnet-version: '9.0.x'
2929
- name: Restore solution
3030
run: dotnet restore
3131
- name: Build solution

.github/workflows/master-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
1717
- name: Checkout source
1818
uses: actions/checkout@v4
19-
- name: Setup .NET 8.0.x
19+
- name: Setup .NET 9.0.x
2020
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: '8.0.x'
22+
dotnet-version: '9.0.x'
2323
- name: Restore solution
2424
run: dotnet restore
2525
- name: Build solution (pre-release)

.github/workflows/master-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
steps:
2020
- name: Checkout source
2121
uses: actions/checkout@v4
22-
- name: Setup .NET 8.0.x
22+
- name: Setup .NET 9.0.x
2323
uses: actions/setup-dotnet@v4
2424
with:
25-
dotnet-version: '8.0.x'
25+
dotnet-version: '9.0.x'
2626
- name: Restore solution
2727
run: dotnet restore
2828
- name: Build solution

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,5 +344,8 @@ healthchecksdb
344344
/test/coverage.opencover.xml
345345
/test/result.json
346346

347+
# POC related
348+
/poc
349+
347350
# Custom exclusions
348351
*.AssemblyAttributes

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ The package currently supports the following authentication methods:
1111
- OAuth2
1212
- Client credentials
1313

14-
> Please note: The .NET Standard 2.0 and .NET 6 targeted packages references the LTS version 6 of the dependent
15-
NuGet packages. The reason for this is that while it is possible to run .NET 7 NuGet packages on .NET 6, it is known that some
16-
of them may introduce unexpected behavior. It is recommended (especially from the ASP.NET Core team) limit usage of .NET 7
17-
based NuGet packages on .NET 6 runtime.
18-
1914
## USAGE
2015

2116
Add the NuGet package `KISS.HttpClientAuthentication` to your project and whenever a
@@ -75,16 +70,25 @@ Authentication using OAuth2.
7570

7671
##### Client credentials
7772

78-
Using OAuth2 client credentials, all settings except `DisableTokenCache` and `Scope` is required.
73+
Using OAuth2 client credentials, all settings except `DisableTokenCache`, `Scope` and
74+
`TokenEndpoint`'s `Additional*Parameters` is required.
7975

8076
```
8177
"<section name>": {
8278
"AuthenticationProvider": "OAuth2",
8379
"OAuth2": {
84-
"AuthorizationEndpoint": "<OAuth2 token endpoint>",
8580
"DisableTokenCache": false,
8681
"GrantType": "ClientCredentials",
8782
"Scope": "<Optional scopes separated by space>",
83+
"TokenEndpoint": {
84+
"Url": "<OAuth2 token endpoint>",
85+
"AdditionalHeaderParameters": {
86+
},
87+
"AdditionalBodyParameters": {
88+
},
89+
"AdditionalQueryParameters": {
90+
}
91+
},
8892
"ClientCredentials": {
8993
"ClientId": "<Unique client id>",
9094
"ClientSecret": "<Secret connected to the client id>"
@@ -93,6 +97,9 @@ Using OAuth2 client credentials, all settings except `DisableTokenCache` and `Sc
9397
}
9498
```
9599

100+
The `Additional*Parameters` configuration is dynamic, any configuration in these will
101+
be added to their respective parts of the request accordingly. Please note that the
102+
`AdditionalQueryParameters` will be url encoded.
96103

97104
### Examples
98105

src/HttpClientAuthentication/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Rune Gulbrandsen.
1+
// Copyright © 2025 Rune Gulbrandsen.
22
// All rights reserved. Licensed under the MIT License; see LICENSE.txt.
33

44
using System.Runtime.CompilerServices;

src/HttpClientAuthentication/Configuration/ApiKeyConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Rune Gulbrandsen.
1+
// Copyright © 2025 Rune Gulbrandsen.
22
// All rights reserved. Licensed under the MIT License; see LICENSE.txt.
33

44
namespace KISS.HttpClientAuthentication.Configuration

src/HttpClientAuthentication/Configuration/BasicConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Rune Gulbrandsen.
1+
// Copyright © 2025 Rune Gulbrandsen.
22
// All rights reserved. Licensed under the MIT License; see LICENSE.txt.
33

44
namespace KISS.HttpClientAuthentication.Configuration

src/HttpClientAuthentication/Configuration/ClientCredentialsConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Rune Gulbrandsen.
1+
// Copyright © 2025 Rune Gulbrandsen.
22
// All rights reserved. Licensed under the MIT License; see LICENSE.txt.
33

44
namespace KISS.HttpClientAuthentication.Configuration

src/HttpClientAuthentication/Configuration/HttpClientAuthenticationConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Rune Gulbrandsen.
1+
// Copyright © 2025 Rune Gulbrandsen.
22
// All rights reserved. Licensed under the MIT License; see LICENSE.txt.
33

44
using KISS.HttpClientAuthentication.Constants;

0 commit comments

Comments
 (0)