feat: Add WordPress.com OAuth support to Android demo app#339
Draft
feat: Add WordPress.com OAuth support to Android demo app#339
Conversation
5eeb6cc to
0b13e7f
Compare
0b13e7f to
8681b6b
Compare
Support both self-hosted (Application Passwords) and WordPress.com (OAuth2) authentication in the Android demo app by adopting the new wordpress-rs authentication API. Key changes: - Update wordpress-rs to version with OAuth2 support - Rewrite AuthenticationManager to branch on DiscoveredAuthenticationMechanism - Migrate site persistence from SharedPreferences to encrypted AccountRepository - Add GutenbergKitApplication for AccountRepository initialization - Update SiteCapabilitiesDiscovery to use autodiscovery with WP.com route handling - Add OAuth callback intent filter and credentials template Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8681b6b to
6bc5e33
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What?
Add WordPress.com OAuth2 authentication support to the Android demo app, alongside the existing Application Passwords flow for self-hosted sites.
Why?
The
wordpress-rslibrary now distinguishes between Application Passwords and OAuth2 authentication mechanisms (viaDiscoveredAuthenticationMechanism). This PR adopts that API change so the demo app can connect to both self-hosted WordPress sites and WordPress.com sites.How?
wordpress-rsto the version from PR #1190 and Kotlin to 2.1.21 for compatibilitysuccess.authentication— launch Application Passwords browser flow for self-hosted, OAuth2 browser flow for WP.com. OAuth credentials loaded from a gitignored JSON asset fileConfigurationStorage(SharedPreferences) withAccountRepository(encrypted, Rust-backed via Android Keystore). AddGutenbergKitApplicationfor initializationaccountIdfield andfromAccount()factory that handles bothAccount.SelfHostedSite(Basic auth) andAccount.WpCom(Bearer auth)WpLoginClient.apiDiscovery()for all sites. For WP.com, also check rewritten route paths with/sites/{slug}/inserted after namespace prefixgutenbergkit://wpcom-authorized)Testing Instructions
wp_com_oauth_credentials.json.exampletowp_com_oauth_credentials.jsonin assets, fill in client_id/secret → enter a WP.com site URL (e.g.,example.wordpress.com) → OAuth browser flow → verify capabilities show green checks and editor loads🤖 Generated with Claude Code