Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,9 @@
<EnableFAPIEnforcement>{{oauth.dcr.enable_fapi_enforcement}}</EnableFAPIEnforcement>
<EnableSectorIdentifierURIValidation>{{oauth.dcr.enable_sector_identifier_validation}}</EnableSectorIdentifierURIValidation>
<ReturnNullFieldsInResponse>{{oauth.dcrm.return_null_fields_in_response}}</ReturnNullFieldsInResponse>
{% if oauth.dcrm.decode_redirect_uris_in_response is defined %}
<DecodeRedirectUrisInResponse>{{oauth.dcrm.decode_redirect_uris_in_response}}</DecodeRedirectUrisInResponse>
{% endif %}

@coderabbitai coderabbitai Bot Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

@BimsaraBodaragama BimsaraBodaragama Jun 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR was closed. Hence, ignoring this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

</DCRM>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"oauth.grant_type.ciba.allow_public_client": false,
"oauth.dcrm.application_role_permission_required_to_view": true,
"oauth.dcrm.return_null_fields_in_response": false,
"oauth.dcrm.decode_redirect_uris_in_response": false,
"oauth.dcr.enable_fapi_enforcement": false,
"oauth.dcr.enable_sector_identifier_validation": false,
"oauth.dcr.authentication_required": true,
Expand Down
Loading