Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces OAuth2 section with self-hosted test instructions #20928

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 5 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,8 @@ If you're a developer wanting to contribute, read on.

Notes:

* To use WordPress.com features (login to WordPress.com, access Reader and Stats, etc) you need a WordPress.com OAuth2 ID and secret. Please read the [OAuth2 Authentication](#oauth2-authentication) section.
* While loading/building the app in Android Studio ignore the prompt to update the gradle plugin version as that will probably introduce build errors. On the other hand, feel free to update if you are planning to work on ensuring the compatibility of the newer version.


## OAuth2 Authentication ##

In order to use WordPress.com functions you will need a client ID and
a client secret key. These details will be used to authenticate your
application and verify that the API calls being made are valid. You can
create an application or view details for your existing applications with
our [WordPress.com applications manager][5].

When creating your application, you should select "Native client" for the application type.
The "**Website URL**", "**Redirect URLs**", and "**Javascript Origins**" fields are required but not used for
the mobile apps. Just use "**[https://localhost](https://localhost)**".

Once you've created your application in the [applications manager][5], you'll
need to edit the `./gradle.properties` file and change the
`wp.oauth.app_id` and `wp.oauth.app_secret` fields. Then you can compile and
run the app on a device or an emulator and try to login with a WordPress.com
account. Note that authenticating to WordPress.com via Google is not supported
in development builds of the app, only in the official release.

Note that credentials created with our [WordPress.com applications manager][5]
allow login only and not signup. New accounts must be created using the [official app][1]
or [on the web](https://wordpress.com/start). Login is restricted to the WordPress.com
account with which the credentials were created. In other words, if the credentials
were created with foo@email.com, you will only be able to login with foo@email.com.
Using another account like bar@email.com will cause the `Client cannot use "password" grant_type` error.

For security reasons, some account-related actions aren't supported for development
builds when using a WordPress.com account with 2-factor authentication enabled.

Read more about [OAuth2][6] and the [WordPress.com REST endpoint][7].

## Build and Test ##

To build, install, and test the project from the command line:
Expand All @@ -61,6 +28,11 @@ To build, install, and test the project from the command line:
$ ./gradlew :WordPress:testWordPressVanillaDebugUnitTest # assemble, install and run unit tests
$ ./gradlew :WordPress:connectedWordPressVanillaDebugAndroidTest # assemble, install and run Android tests

## Running the app ##

You can use your own WordPress site for developing and testing the app. If you don't have one, you can create a temporary test site for free at https://jurassic.ninja/.
On the app start up screen choose "Enter your existing site address" and enter the URL of your site and your credentials.
irfano marked this conversation as resolved.
Show resolved Hide resolved

## Directory structure ##
.
├── libs # dependencies used to build debug variants
Expand Down
Loading