Add DecodeRedirectUrisInResponse config knob for DCR redirect_uris response#8174
Add DecodeRedirectUrisInResponse config knob for DCR redirect_uris response#8174BimsaraBodaragama wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds a new OAuth DCRM configuration property ChangesDCRM Redirect URI Decoding Configuration
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2`:
- Around line 1301-1303: The `is defined` check in the
DecodeRedirectUrisInResponse template block is ineffective because the default
configuration already defines oauth.dcrm.decode_redirect_uris_in_response with a
value of false, making the condition always evaluate to true. To fix this,
either remove the default declaration of
oauth.dcrm.decode_redirect_uris_in_response from the defaults configuration file
so the key is only defined when explicitly set by users, or introduce a separate
explicit-enable flag (like oauth.dcrm.explicitly_set_decode_redirect_uris) that
can be checked in the template instead of relying on the is defined guard.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: d3b97cdf-3a4c-4ec1-9836-0f0611d6d0cc
📒 Files selected for processing (2)
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/org.wso2.carbon.identity.core.server.feature.default.json
| {% if oauth.dcrm.decode_redirect_uris_in_response is defined %} | ||
| <DecodeRedirectUrisInResponse>{{oauth.dcrm.decode_redirect_uris_in_response}}</DecodeRedirectUrisInResponse> | ||
| {% endif %} |
There was a problem hiding this comment.
is defined guard is ineffective if the default file always defines this key.
Given this PR stack also introduces oauth.dcrm.decode_redirect_uris_in_response=false in defaults, this condition will always pass and <DecodeRedirectUrisInResponse> will always be emitted. That breaks the stated “only when explicitly set” behavior. Consider either removing the default-key declaration or introducing a separate explicit-enable marker for template emission.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2`
around lines 1301 - 1303, The `is defined` check in the
DecodeRedirectUrisInResponse template block is ineffective because the default
configuration already defines oauth.dcrm.decode_redirect_uris_in_response with a
value of false, making the condition always evaluate to true. To fix this,
either remove the default declaration of
oauth.dcrm.decode_redirect_uris_in_response from the defaults configuration file
so the key is only defined when explicitly set by users, or introduce a separate
explicit-enable flag (like oauth.dcrm.explicitly_set_decode_redirect_uris) that
can be checked in the template instead of relying on the is defined guard.
There was a problem hiding this comment.
The PR was closed. Hence, ignoring this.
There was a problem hiding this comment.
@BimsaraBodaragama, understood — since the PR is closed, no action is needed here. Thanks for the update.
🧠 Learnings used
Learnt from: Thumimku
Repo: wso2/carbon-identity-framework PR: 7730
File: features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2:1192-1208
Timestamp: 2026-03-11T07:46:22.960Z
Learning: In features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2, the OAuth TokenPersistence config elements (PersistAccessToken, PersistRefreshToken, KeepRevokedAccessTokens) are parsed by the upstream identity-inbound-auth-oauth module (OAuthServerConfiguration.parseTokenPersistenceConfiguration) and not by this repository's Java code. Do not rely on or modify local Java parsing for these tokens. Treat identity.xml.j2 as a template that may be consumed by upstream configuration, and avoid introducing changes that assume local parsing of TokenPersistence settings. If changes are needed, coordinate with upstream module behavior and document the dependency in comments or release notes.
|
Closing — wrong target. IS 7.3 fix goes to wso2-support branch, not public master. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8174 +/- ##
============================================
+ Coverage 52.77% 52.81% +0.03%
+ Complexity 21216 21178 -38
============================================
Files 2197 2197
Lines 130819 130615 -204
Branches 19654 19622 -32
============================================
- Hits 69040 68978 -62
+ Misses 53364 53241 -123
+ Partials 8415 8396 -19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The effort will be tracked via the below PR |



Root cause and fix
regexp=(uri1|uri2|...)encoding as a single-elementredirect_urisarray instead of the original URI list.DecodeRedirectUrisInResponseknob that gates the decode fix inidentity-inbound-auth-oauth.{% if oauth.dcrm.decode_redirect_uris_in_response is defined %}guard ensures no change to the generatedidentity.xmlunless the property is set.Related PR
wso2-extensions/identity-inbound-auth-oauth#3262
Linked issue
wso2/product-is#27851