You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Scenario: a site where the admin area is served over SSL (via FORCE_SSL_ADMIN) and the front end is served over HTTP.
The intent of this, of course, is to prevent credentials being sent in plain text over HTTP.
WP-API uses home_url() rather than site_url() to build its endpoint URL. This means in the scenario above, the endpoint URL shown in RSD uses HTTP rather than HTTPS. When I go to use the API and I'm submitting my user credentials, they're being sent as plain text over HTTP! Oh noes!
The solution is for WP-API to use site_url() (and probably rpc as the $scheme parameter) rather than using home_url() in get_json_url(). This does mean, however, that if a site's WordPress installation is in a subdirectory then this will show up in the endpoint URL too (eg. example.com/wordpress/wp-json).
You'll note that the XML-RPC endpoints listed at example.com/xmlrpc.php?rsd all use site_url() rather than home_url(). WP-API is currently the odd one out here.