fix(auth): update app-attestation OAuth error wire values - #2977
Merged
sfdctaka merged 1 commit intoAug 5, 2026
Conversation
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
marked this pull request as ready for review
August 5, 2026 18:31
wmathurin
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Salesforce server renamed two token-endpoint error codes for app attestation:
client_blockedapp_attest_failedclient_blocked_retryapp_attest_failed_retryThis 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_blocked→app_attest_failed,client_blocked_retry→app_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.javaruntime code — all consumers are enum-keyed, so the wire swap propagates automatically.OAuth2.javaLogoutReason.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— cleanRelated