feat: Add WordPress.com OAuth support to iOS and Android demo apps#339
Draft
feat: Add WordPress.com OAuth support to iOS and Android demo apps#339
Conversation
5eeb6cc to
0b13e7f
Compare
8681b6b to
6bc5e33
Compare
Add OAuth2 authentication for WordPress.com sites alongside the existing Application Passwords flow for self-hosted sites. - Branch on DiscoveredAuthenticationMechanism to launch the appropriate auth flow (Application Passwords or OAuth2) - Store WP.com accounts as Account.WpCom so auth type is determined by pattern matching rather than URL sniffing - Replace SharedPreferences with encrypted AccountRepository from wordpress-rs, backed by Android Keystore - Load OAuth client credentials from a shared project-root JSON file - Add WP.com site namespace handling in SitePreparationViewModel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace fetch-based editor asset loading with config injection via window.GBKit.editorAssets, removing the manifest message handler from EditorAssetBundleProvider - Add editorAssets support to GBKitGlobal on both iOS and Android - Guard against duplicate site namespace insertion in the API path modifier middleware - Remove fetchEditorAssets from the JS bridge exports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The block inserter shows Paragraph in both "Most Used" and "Text" sections, causing `app.buttons["Paragraph"]` to match multiple elements. Use `.firstMatch` to select the first one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add OAuth2 authentication for WordPress.com sites to the iOS demo app, with encrypted credential storage and proper WP.com API routing. - Add AuthenticationManager with async/throws API supporting both Application Passwords and OAuth2 flows - Replace UserDefaults-based ConfigurationStorage with encrypted AccountRepository from wordpress-rs (SecureEnclavePasswordTransformer) - Use WpComDotOrgApiUrlResolver for correct WP.com API URL routing - Propagate errors from ConfigurationStorage instead of swallowing them - Move shared OAuth credentials file to project root, referenced by both platforms via relative paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33d52c7 to
22384d6
Compare
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 both the Android and iOS demo apps, alongside the existing Application Passwords flow for self-hosted sites.
Why?
The demo apps previously only supported self-hosted WordPress sites via Application Passwords. This PR adds OAuth2 support so the apps can also connect to WordPress.com sites, and upgrades credential storage to use encrypted repositories on both platforms.
How?
Android
DiscoveredAuthenticationMechanismto launch the appropriate auth flow (Application Passwords or OAuth2)Account.WpComso auth type is determined by pattern matchingSharedPreferenceswith encryptedAccountRepositoryfrom wordpress-rs, backed by Android KeystoreSitePreparationViewModeliOS
AuthenticationManagerwith async/throws API supporting both Application Passwords and OAuth2 flowsConfigurationStoragewith encryptedAccountRepositoryfrom wordpress-rs (SecureEnclavePasswordTransformer)WpComDotOrgApiUrlResolverfor correct WP.com API URL routingConfigurationStorageinstead of swallowing themShared (JS/Web)
window.GBKit.editorAssetsTesting Instructions
wp_com_oauth_credentials.json.exampletowp_com_oauth_credentials.jsonin the project root, fill in client_id/secret → enter a WP.com site URL → OAuth browser flow → verify editor loads with plugins and theme styles🤖 Generated with Claude Code