Skip to content

Accept a client secret value in the client secret creation request - #1171

Closed
sadilchamishka wants to merge 1 commit into
wso2:masterfrom
sadilchamishka:feat/client-secret-with-provided-value
Closed

sadilchamishka wants to merge 1 commit into
wso2:masterfrom
sadilchamishka:feat/client-secret-with-provided-value

Conversation

@sadilchamishka

Copy link
Copy Markdown
Contributor

Issue

POST /applications/{applicationId}/inbound-protocols/oidc/client-secrets accepts only an expiry, so the secret value is always generated. An application cannot be given an existing secret that has to be carried over from another identity provider.

Fix

Adds an optional secretValue to ClientSecretCreationRequest and passes it through to OAuthAdminServiceImpl.createOAuthClientSecret. When it is omitted the behaviour is unchanged and a secret is generated.

Depends on wso2-extensions/identity-inbound-auth-oauth#3318, so this can be merged only after identity.inbound.oauth2.version is bumped to a release carrying it.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 18:08
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a85cc077-991c-48ad-8919-496236a6532c
📥 Commits

Reviewing files that changed from the base of the PR and between 4bb5906 and 5a39e76.

⛔ Files ignored due to path filters (1)
  • components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ClientSecretCreationRequest.java is excluded by !**/gen/**
📒 Files selected for processing (2)
  • components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/inbound/oauth2/OAuthInboundFunctions.java
  • components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/resources/applications.yaml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

ClientSecretCreationRequest now supports an optional secretValue. The API passes the supplied value to OAuthAdminServiceImpl.createOAuthClientSecret; when the value is omitted, it passes null, allowing the service to retain its existing generated-secret behavior.

Walkthrough

ClientSecretCreationRequest now documents an optional secretValue. The creation function passes the requested value to the OAuth service, or null when the request is null. Secret expiry handling remains unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 5a39e

No confirmed issue blocks merging. Confirm that OAuth dependency 7.5.87 supports the new call before release.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 5a39e

Caller-selected credentials introduce security requirements beyond generating a new secret. Application and tenant selection remain unchanged, but supplied-secret validation, failure handling, and compatibility with the required OAuth release are not established. No security vulnerability was verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new capability lets a caller reaching the existing creation operation choose a credential for the selected application's OAuth client. The inspected identity path remains tenant-bound and does not allow secretValue to select another client or tenant. Runtime permission enforcement and downstream credential admission remain coverage gaps.

Trust Boundaries and Controls

  • observed — Caller-controlled credential content crosses the API-to-OAuth-service boundary while client and tenant identity remain server-derived. The documented creation permission and tenant/application lookup predate this change. No authorization bypass was established, and documentation alone does not verify deployed enforcement.

Hardening Proposals

  • proposed — Make the compatible OAuth release and its supplied-secret admission policy explicit rollout prerequisites. Establish the credential-state outcomes for duplicate or concurrent requests and persistence followed by response loss before relying on the new path.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, the fix, and the dependency on the OAuth release. It omits most sections required by the repository template, including the developer checklist, release note, doc… Add the missing template sections and provide the required details. For sections that do not apply, state “N/A” and explain why. Complete the Developer Checklist and include unit and integration test coverage, security-check results, and th…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: accepting a client-provided secret value in the client secret creation request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, the fix, and the dependency on the OAuth release. It omits most sections required by the repository template, including the developer checklist, release note, documentation, tests, security checks, and test environment.

Resolution

Add the missing template sections and provide the required details. For sections that do not apply, state “N/A” and explain why. Complete the Developer Checklist and include unit and integration test coverage, security-check results, and the test environment.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

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.

Copilot review overview

🔵 Needs a closer look

It compiles only against an unreleased backend change (identity-inbound-auth-oauth#3318) and the required identity.inbound.oauth2.version bump is not in this PR, so merge timing needs human release coordination.

Review effort: Balanced
Findings: None

What changed in this PR

This PR extends the OIDC client-secret creation endpoint (POST /applications/{applicationId}/inbound-protocols/oidc/client-secrets) so a caller can supply an existing secret value instead of always having one generated. This supports carrying over a client secret from another identity provider. It adds an optional secretValue to the request model and threads it through to the backend OAuthAdminServiceImpl.createOAuthClientSecret call; when omitted, behavior is unchanged.

Changes:

  • Added an optional secretValue string property to ClientSecretCreationRequest in the OpenAPI spec and the committed generated model.
  • Passed request.getSecretValue() into the backend createOAuthClientSecret(...) invocation in OAuthInboundFunctions.
File Description
.../​src/​main/​resources/​applications.yaml Declares the new optional secretValue property on ClientSecretCreationRequest.
.../​src/​gen/​java/​.../​ClientSecretCreationRequest.java Generated model updated with the secretValue field, accessors, and equals/hashCode/toString.
.../​core/​functions/​application/​inbound/​oauth2/​OAuthInboundFunctions.java Forwards the supplied secretValue to the backend client-secret creation call.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants