1

I have installed the plugin made by the Wordpress Team: https://github.com/WP-API/Basic-Auth

I am making this request with Wordpress 4.6.14:

The making a GET request to the following API https://website.com/wp-json/wp/v2/users/me?access_token=blnhszockfpzflz9v7nu312s

To get the user data from WordPress but it's giving me 401 status on new versions of Chrome and Firefox browsers.

I tried this API call using postman and it's working fine.

When I use an older version of Firefox it gives me 302 status.

I have tried all the solutions that are mentioned in "401 Unauthorized with Wordpress Basic Auth Plugin" question plus all solutions mentioned in https://github.com/WP-API/Basic-Auth/issues but still no luck. Please, can anyone help me with this?

Please refer to the following screenshot of my network tab enter image description here

Marius Flevie
  • 97
  • 2
  • 10
  • If you look into the network tab of your debugger, do you see the credentials properly attached to the request? – Ferrybig Apr 30 '19 at 07:06
  • Thanks for your quick reply. I have updated the question with the screenshot of my network tab – Marius Flevie Apr 30 '19 at 07:34
  • Could you show the code you use to mak the above request? Some libraries need certain flags to enable automatic authorization headers – Ferrybig Apr 30 '19 at 08:04
  • This is the code I'm using to make the request. `fetch('/web/wp-json/wp/v2/users/me?access_token='+ token.access_token) .then((response) => {console.log(response)})` I tried with axios library still the same outcome – Marius Flevie Apr 30 '19 at 22:40

0 Answers0