Basic-Auth icon indicating copy to clipboard operation
Basic-Auth copied to clipboard

Basic does not show up as a valid authentication method (or work)

Open birds-inc opened this issue 9 years ago • 3 comments

I've installed and activated WP-API (v2) and Basic-Auth plugin, however, "Basic" does not appear in the list of authentication methods when querying /wp-json.

...
  "namespaces": [
    "wp/v2",
    "oembed/1.0"
  ],
  "authentication": [],
  "routes": {
    "/": {
...

If I install the OAuth plugin, the method does appear:

...
  "namespaces": [
    "wp/v2",
    "oembed/1.0"
  ],
  "authentication": {
    "oauth1": {
      "request": "http://www.crucibleradio.com/oauth1/request",
      "authorize": "http://www.crucibleradio.com/oauth1/authorize",
      "access": "http://www.crucibleradio.com/oauth1/access",
      "version": "0.1"
    }
  },
  "routes": {
    "/": {
...

For any request I make using the Basic authentication method, I get a permissions error:

{
  "code": "rest_cannot_edit",
  "message": "Sorry, you are not allowed to update this post.",
  "data": {
    "status": 401
  }
}

What causes an authentication method to become "registered" with WP-API and show up in that list? Does "Basic" appear as an item in the authentication methods in a working installation?

birds-inc avatar Jun 10 '16 17:06 birds-inc

+1

wblaircox avatar Aug 09 '16 16:08 wblaircox

+1

HeikoBornholdt avatar Aug 15 '16 09:08 HeikoBornholdt

This might help someone coming across this ticket:

As a user with a working installation, I can confirm that "Basic" does NOT appear as an item in the listed authentication methods:

...
"namespaces": [
   "oembed/1.0",
   "2fa/v1",
   "wp-rest-api-log",
   "acf/v3",
   "wp/v2"
],
"authentication": [],
"routes": {
   "/": {
      "namespace": "",
      "methods": [
         "GET"
      ],
"endpoints": 
...

adam-marash avatar Jun 16 '19 12:06 adam-marash