Skip to content

CDAP-21256 : Support preserving client credentials when deleting an OAuth provider#16169

Open
sahusanket wants to merge 1 commit into
developfrom
CDAP-21256_preserve_cred_oauth_provider_delete
Open

CDAP-21256 : Support preserving client credentials when deleting an OAuth provider#16169
sahusanket wants to merge 1 commit into
developfrom
CDAP-21256_preserve_cred_oauth_provider_delete

Conversation

@sahusanket

@sahusanket sahusanket commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Testing :

  • Create provider with Cred :
curl -X PUT "${BASE_URL}/${PROVIDER}?reuse_client_credentials=false" \
  -H "Content-Type: application/json" \
  -d '{
    "loginURL": "https://login.salesforce.com/services/oauth2/authorize",
    "tokenRefreshURL": "https://login.salesforce.com/services/oauth2/token",
    "clientId": "3MVG9lKcPoaZ_ORIGINAL_ID",
    "clientSecret": "super_secret_password_v1",
    "strategy": "FORM_BODY",
    "userAgent": "CDAP-Pipeline/1.0"
  }'
  • Delete
curl -X DELETE "${BASE_URL}/${PROVIDER}?preserve_client_credentials=true"
  • Create provider with reuse_client_credentials=true
curl -X PUT "${BASE_URL}/${PROVIDER}?reuse_client_credentials=false" \
  -H "Content-Type: application/json" \
  -d '{
    "loginURL": "https://login.salesforce.com/services/oauth2/authorize",
    "tokenRefreshURL": "https://login.salesforce.com/services/oauth2/token",
    "strategy": "FORM_BODY",
    "userAgent": "CDAP-Pipeline/1.0"
  }'

SUCCESS

If the secrets were not present in backend, it will throw an error.

@sahusanket sahusanket self-assigned this Jun 19, 2026
@sahusanket sahusanket added the build Triggers github actions build label Jun 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a preserve_client_credentials option when deleting an OAuth provider, allowing users to preserve existing secrets in the secure store. This is implemented by adding a preserveClientCredentials parameter to OAuthStore.deleteProvider and exposing it as a query parameter in the OAuthHandler DELETE endpoint, along with corresponding unit tests. The review feedback suggests changing the query parameter type in OAuthHandler from boxed Boolean to primitive boolean to avoid a potential NullPointerException during auto-unboxing, which would otherwise result in an incorrect 'Invalid provider' error response.

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

Labels

build Triggers github actions build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant