Skip to content

fix(auth): update app-attestation OAuth error wire values - #2977

Merged
sfdctaka merged 1 commit into
forcedotcom:devfrom
sfdctaka:fix/attestation-wire-value-rename
Aug 5, 2026
Merged

fix(auth): update app-attestation OAuth error wire values#2977
sfdctaka merged 1 commit into
forcedotcom:devfrom
sfdctaka:fix/attestation-wire-value-rename

Conversation

@sfdctaka

@sfdctaka sfdctaka commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

The Salesforce server renamed two token-endpoint error codes for app attestation:

Old value New value
client_blocked app_attest_failed
client_blocked_retry app_attest_failed_retry

This PR updates the Android SDK to use the new wire values so that attestation-blocked users continue to see the correct error message and logout behavior after the server change deploys.

Changes

Production (2 files):

  • OAuthErrorCode.kt — swap two wire string ctor arguments (client_blockedapp_attest_failed, client_blocked_retryapp_attest_failed_retry). Enum symbolic names (APP_ATTESTATION_FAILED, APP_ATTESTATION_FAILED_RETRY) are unchanged — they are internal identifiers, not wire strings.
  • ClientManager.java — update three stale references in Javadoc/comments to match new wire values. No runtime code changes.

Tests (4 files):

  • OAuthErrorCodeTest.kt — rename two test methods; update wire literals.
  • AuthenticatorServiceTest.kt — rename two test methods; update wire strings and assertions.
  • LoginViewModelMockTest.kt — rename two test methods; update wire strings.
  • ClientManagerMockTest.kt — rename four test methods; update wire strings, inline JSON body, and one comment.

Notably untouched:

  • LoginActivity.kt, AuthenticatorService.java, ClientManager.java runtime code — all consumers are enum-keyed, so the wire swap propagates automatically.
  • OAuth2.java LogoutReason.CLIENT_BLOCKED — internal identifier, not a wire string; renaming would be a public API break.
  • sf__strings.xml — no localization change required.

Test Plan

  • ./gradlew :libs:SalesforceSDK:compileDebugKotlin — clean compile
  • ./gradlew :libs/test/SalesforceSDKTest:testDebugUnitTest --tests "*OAuthErrorCodeTest*" — all pass
  • ./gradlew :libs/test/SalesforceSDKTest:connectedAndroidTest --tests "*AuthenticatorServiceTest*" — all pass
  • ./gradlew :libs/test/SalesforceSDKTest:connectedAndroidTest --tests "*LoginViewModelMockTest*" — all pass
  • ./gradlew :libs/test/SalesforceSDKTest:connectedAndroidTest --tests "*ClientManagerMockTest*" — all pass
  • ./gradlew :libs:SalesforceSDK:lint — clean

Related

Server renamed two token-endpoint error codes:
- client_blocked        → app_attest_failed
- client_blocked_retry  → app_attest_failed_retry

Update OAuthErrorCode enum wire strings to match. All production
consumers (LoginActivity, AuthenticatorService, ClientManager) are
enum-keyed so they continue to work with no runtime code change.

Also update stale references in ClientManager Javadoc/comments and
rename test methods across four test files to reflect the new values.
@sfdctaka
sfdctaka marked this pull request as ready for review August 5, 2026 18:31
@sfdctaka
sfdctaka requested a review from wmathurin August 5, 2026 18:31
@sfdctaka
sfdctaka merged commit 6bc2d07 into forcedotcom:dev Aug 5, 2026
5 of 6 checks passed
@sfdctaka
sfdctaka deleted the fix/attestation-wire-value-rename branch August 5, 2026 21:58
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