Merge branch dev with rel-10.5#25741
Merged
Merged
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…r-authenticated-client Forward the current access token for authenticated client requests
voloagent
approved these changes
Jul 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This auto-generated merge brings in a behavioral fix (and accompanying tests) for HttpContextAbpAccessTokenProvider in the Volo.Abp.Http.Client.IdentityModel.Web package, ensuring access tokens can be forwarded for authenticated principals that may not represent an ABP “current user” (e.g., client_credentials flows).
Changes:
- Updated
HttpContextAbpAccessTokenProviderto rely onHttpContext.User.Identity.IsAuthenticatedinstead ofICurrentUser.IsAuthenticated. - Added a dedicated authentication handler used by tests to make an
access_tokenretrievable viaHttpContext.GetTokenAsync. - Added integration tests covering authenticated user, authenticated client without user id, and anonymous request scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/TestTokenAuthHandler.cs | Adds a test auth handler that injects an access_token into AuthenticationProperties for GetTokenAsync retrieval. |
| framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextAbpAccessTokenProvider_Tests.cs | Adds integration tests validating token forwarding behavior for authenticated user/client and not for anonymous requests. |
| framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextAbpAccessTokenProvider.cs | Adjusts the “authenticated” check to use HttpContext.User instead of ICurrentUser, enabling forwarding for authenticated non-user principals. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #25741 +/- ##
==========================================
+ Coverage 48.86% 48.87% +0.01%
==========================================
Files 3733 3733
Lines 126277 126277
Branches 9709 9709
==========================================
+ Hits 61707 61722 +15
+ Misses 62726 62709 -17
- Partials 1844 1846 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR generated automatically to merge dev with rel-10.5. Please review the changed files before merging to prevent any errors that may occur.