From 6cf8d5f6134c08117189717a62d3c7cca29e6ddf Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 10:22:39 -0500 Subject: [PATCH 1/8] Ignore MacOs generated files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 504f734..60e14c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# MacOS +.DS_Store + # Rider .idea From c0a2e14865a3f18ad9ca565dd2cb50fe8f8e1451 Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 11:59:41 -0500 Subject: [PATCH 2/8] Expand repo readme, add readmes for each package --- README.md | 27 ++++++++++++++++--- ...AccessTokenManagement.OpenIdConnect.csproj | 6 ++++- .../README.md | 20 ++++++++++++++ .../Duende.AccessTokenManagement.csproj | 7 +++-- src/Duende.AccessTokenManagement/README.md | 22 +++++++++++++++ 5 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 src/Duende.AccessTokenManagement.OpenIdConnect/README.md create mode 100644 src/Duende.AccessTokenManagement/README.md diff --git a/README.md b/README.md index de736d2..1cdb1bd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ -# Duende.AccessTokenManagement -Automatic access token management for machine to machine and user-centric OAuth and OIDC flows +## About Duende.AccessTokenManagement +This is the repository for a set of .NET libraries that manage OAuth and OpenId +Connect access tokens. These tools automatically acquire new tokens when old +tokens are about to expire, provide conveniences for using the current token +with HTTP clients, and can revoke tokens that are no longer needed. -[Documentation](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/wiki) +## Packages +The libraries in this repository are distributed as NuGet packages. + +- [Duende.AccessTokenManagement](https://www.nuget.org/packages/Duende.AccessTokenManagement) manages tokens acquired in machine-to-machine flows in +[.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers). +- [Duende.AccessTokenManagement.OpenIdConnect](https://www.nuget.org/packages/Duende.AccessTokenManagement.OpenIdConnect) +manages tokens acquired in user-centric flows in [ASP.NET Core](https://dotnet.microsoft.com/en-us/apps/aspnet) +applications. + +## Documentation +Documentation is available [here](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/wiki). + +## License and Feedback +Duende.AccessTokenManagement is released as open source under the +[Apache 2.0 license](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/blob/main/LICENSE). +[Bug reports, feature requests](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/issues) and +[contributions](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/pulls) are welcome. +If you have an idea for a new feature or significant code change you'd like to propose, please start with a +GitHub issue so that we can discuss it. Thanks in advance! \ No newline at end of file diff --git a/src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj b/src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj index b2f063a..629aa96 100644 --- a/src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj +++ b/src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj @@ -4,11 +4,15 @@ net8.0 enable true - + README.md Duende.AccessTokenManagement.OpenIdConnect Automatic access token management for interactive OpenIdConnect-based ASP.NET Core applications + + + + diff --git a/src/Duende.AccessTokenManagement.OpenIdConnect/README.md b/src/Duende.AccessTokenManagement.OpenIdConnect/README.md new file mode 100644 index 0000000..5db49f0 --- /dev/null +++ b/src/Duende.AccessTokenManagement.OpenIdConnect/README.md @@ -0,0 +1,20 @@ +## About Duende.AccessTokenManagement.OpenIdConnect +Duende.AccessTokenManagement.OpenIdConnect is a .NET library that manages OpenId +Connect access tokens in [ASP.NET Core](https://dotnet.microsoft.com/en-us/apps/aspnet) +applications. It will acquire new tokens when old tokens are about to expire, provides conveniences to +automatically use the current token with HTTP clients, and can revoke refresh tokens that are no longer needed. + +## Documentation +Documentation is available [here](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/wiki/web-applications). + +## Related Packages +- Foundational library for claims-based identity, OAuth 2.0 and OpenId Connect: [IdentityModel](https://www.nuget.org/packages/IdentityModel) +- Token management for machine-to-machine workflows in .NET workers: [Duende.AccessTokenManagement](https://www.nuget.org/packages/Duende.AccessTokenManagement) + +## License and Feedback +Duende.AccessTokenManagement.OpenIdConnect is released as open source under the +[Apache 2.0 license](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/blob/main/LICENSE). +[Bug reports, feature requests](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/issues) and +[contributions](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/pulls) are welcome. +If you have an idea for a new feature or significant code change you'd like to propose, please start with a +GitHub issue so that we can discuss it. Thanks in advance! \ No newline at end of file diff --git a/src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj b/src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj index 08b512b..4daa21c 100644 --- a/src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj +++ b/src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj @@ -4,12 +4,15 @@ net8.0 enable true - + README.md Duende.AccessTokenManagement Automatic access token management for OAuth client credential flows - + + + + diff --git a/src/Duende.AccessTokenManagement/README.md b/src/Duende.AccessTokenManagement/README.md new file mode 100644 index 0000000..c7a4f3f --- /dev/null +++ b/src/Duende.AccessTokenManagement/README.md @@ -0,0 +1,22 @@ +## About Duende.AccessTokenManagement +Duende.AccessTokenManagement is a .NET library that manages OAuth +access tokens in [.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers). +It will acquire new tokens when old tokens are about to expire and provides conveniences to +automatically use the current token with HTTP clients. + +## Documentation +Documentation is available [here](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/wiki). + +## Related Packages +- Foundational library for claims-based identity, OAuth 2.0 and OpenId Connect: [IdentityModel](https://www.nuget.org/packages/IdentityModel) +- Token management for user-centric flows in [ASP.NET Core](https://dotnet.microsoft.com/en-us/apps/aspnet) +applications: [Duende.AccessTokenManagement.OpenIdConnect](https://www.nuget.org/packages/Duende.AccessTokenManagement.OpenIdConnect) + +## License and Feedback +Duende.AccessTokenManagement is released as open source under the +[Apache 2.0 license](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/blob/main/LICENSE). +[Bug reports, feature requests](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/issues) and +[contributions](https://github.com/DuendeSoftware/Duende.AccessTokenManagement/pulls) are welcome. +If you have an idea for a new feature or significant code change you'd like to propose, please start with a +GitHub issue so that we can discuss it. Thanks in advance! + From fcb1ae2acb558ac726488bbcd69f8805594d29dd Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 13:19:33 -0500 Subject: [PATCH 3/8] Update IdentityServer dependency (tests only) --- Directory.Build.targets | 2 +- test/Tests/Tests.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 2a984d5..62cf7ba 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,7 +3,7 @@ 8.0.3 8.0.0 7.1.2 - 7.0.5 + 7.0.6 diff --git a/test/Tests/Tests.csproj b/test/Tests/Tests.csproj index cb8b7a7..77c3542 100644 --- a/test/Tests/Tests.csproj +++ b/test/Tests/Tests.csproj @@ -17,8 +17,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 5e70fb1fe48b5f8a8ec23c292f5de458b4a79634 Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 15:26:04 -0500 Subject: [PATCH 4/8] Bump dependencies in samples --- samples/BlazorServer/BlazorServer.csproj | 4 ++-- samples/Web/Web.csproj | 4 ++-- samples/WebJarJwt/WebJarJwt.csproj | 4 ++-- samples/Worker/Worker.csproj | 4 ++-- samples/WorkerDI/WorkerDI.csproj | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/BlazorServer/BlazorServer.csproj b/samples/BlazorServer/BlazorServer.csproj index af7a6de..85527f6 100644 --- a/samples/BlazorServer/BlazorServer.csproj +++ b/samples/BlazorServer/BlazorServer.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/Web/Web.csproj b/samples/Web/Web.csproj index 9ea917c..108410a 100644 --- a/samples/Web/Web.csproj +++ b/samples/Web/Web.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/samples/WebJarJwt/WebJarJwt.csproj b/samples/WebJarJwt/WebJarJwt.csproj index 1bf3b46..6faf19d 100644 --- a/samples/WebJarJwt/WebJarJwt.csproj +++ b/samples/WebJarJwt/WebJarJwt.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/samples/Worker/Worker.csproj b/samples/Worker/Worker.csproj index 82bd102..e945d77 100644 --- a/samples/Worker/Worker.csproj +++ b/samples/Worker/Worker.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/samples/WorkerDI/WorkerDI.csproj b/samples/WorkerDI/WorkerDI.csproj index 82bd102..7c0ae15 100644 --- a/samples/WorkerDI/WorkerDI.csproj +++ b/samples/WorkerDI/WorkerDI.csproj @@ -6,7 +6,7 @@ - + From 74c33e8b14f53030c7c1e353a731703d3fe1c750 Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 15:26:35 -0500 Subject: [PATCH 5/8] Bump transitive dependencies in tests --- test/Tests/Tests.csproj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/Tests/Tests.csproj b/test/Tests/Tests.csproj index 77c3542..18d1fba 100644 --- a/test/Tests/Tests.csproj +++ b/test/Tests/Tests.csproj @@ -29,7 +29,18 @@ + + + + + + + + + From 956f5efc85a932bf206b46c41e69d3a018ed60ce Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 15:27:36 -0500 Subject: [PATCH 6/8] Relax framework dependency from 8.0.3 to 8.0.1 8.0.1 is the minimum version of the oidc handler that we can safely depend on, so we use it. --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 62cf7ba..a4ce6b9 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,6 @@ - 8.0.3 + 8.0.1 8.0.0 7.1.2 7.0.6 From d4bb404fb384b04eb356464c77238cbe180c0d0c Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 16:16:31 -0500 Subject: [PATCH 7/8] Updates from review --- README.md | 2 +- src/Duende.AccessTokenManagement/README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1cdb1bd..6496e2d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ with HTTP clients, and can revoke tokens that are no longer needed. The libraries in this repository are distributed as NuGet packages. - [Duende.AccessTokenManagement](https://www.nuget.org/packages/Duende.AccessTokenManagement) manages tokens acquired in machine-to-machine flows in -[.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers). +[.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) and [ASP.NET worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). - [Duende.AccessTokenManagement.OpenIdConnect](https://www.nuget.org/packages/Duende.AccessTokenManagement.OpenIdConnect) manages tokens acquired in user-centric flows in [ASP.NET Core](https://dotnet.microsoft.com/en-us/apps/aspnet) applications. diff --git a/src/Duende.AccessTokenManagement/README.md b/src/Duende.AccessTokenManagement/README.md index c7a4f3f..b8927c1 100644 --- a/src/Duende.AccessTokenManagement/README.md +++ b/src/Duende.AccessTokenManagement/README.md @@ -1,6 +1,7 @@ ## About Duende.AccessTokenManagement Duende.AccessTokenManagement is a .NET library that manages OAuth -access tokens in [.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers). +access tokens in [.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) +and [ASP.NET worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). It will acquire new tokens when old tokens are about to expire and provides conveniences to automatically use the current token with HTTP clients. From 58423021f8071fa2172f5730ac0f4cd3971c7e6f Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Mon, 12 Aug 2024 16:19:36 -0500 Subject: [PATCH 8/8] "ASP.NET Core" not "ASP.NET" --- README.md | 2 +- src/Duende.AccessTokenManagement/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6496e2d..61afeab 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ with HTTP clients, and can revoke tokens that are no longer needed. The libraries in this repository are distributed as NuGet packages. - [Duende.AccessTokenManagement](https://www.nuget.org/packages/Duende.AccessTokenManagement) manages tokens acquired in machine-to-machine flows in -[.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) and [ASP.NET worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). +[.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) and [ASP.NET Core worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). - [Duende.AccessTokenManagement.OpenIdConnect](https://www.nuget.org/packages/Duende.AccessTokenManagement.OpenIdConnect) manages tokens acquired in user-centric flows in [ASP.NET Core](https://dotnet.microsoft.com/en-us/apps/aspnet) applications. diff --git a/src/Duende.AccessTokenManagement/README.md b/src/Duende.AccessTokenManagement/README.md index b8927c1..3b8b0e3 100644 --- a/src/Duende.AccessTokenManagement/README.md +++ b/src/Duende.AccessTokenManagement/README.md @@ -1,7 +1,7 @@ ## About Duende.AccessTokenManagement Duende.AccessTokenManagement is a .NET library that manages OAuth access tokens in [.NET workers](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) -and [ASP.NET worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). +and [ASP.NET Core worker services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services). It will acquire new tokens when old tokens are about to expire and provides conveniences to automatically use the current token with HTTP clients.