Wordpress api not authorized

Trying to solve an issue with lightspeed cache, i want to add a domain key.

  1. The POST callback to website/wp-json/litespeed/v1/token failed.
  2. Our Current Online Server IPs was not whitelisted.

Somehow the callback is not working since i cant even acces the url. Tried disabling the firewall and everything for 10 minutes and disabling cloudflare, also adding all the ips to cloudflare whitelisting nothing seems to be working. Anyone has an idea why this is happening?

Is this your actual URL? I am getting 401.

Did you enable ModSec ?

Updating .htaccess File

Please make sure you have added below line in .htaccess

SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

Test and let us know result :slight_smile: don’t forget to grace restart LS

Yes i had modsec enabled also tried disabling all security but nothing works.

Thanks, i added it but does not seem to work restarted the litespeed server

Litespeed cache problem - General - Cloudflare Community this guy is having the same issue it seems.

do you use wordfence ?

I had this same issue, it should be probably application level issue (wordpress). Disable all the plugins you have in wordpress and activate only the litespeed plugin in question and check whether it solves the issue.

:+1: yes and last time I face it because of wordfence block so he need whitelist in case of wordfence

1 Like

No this was not the issue, managed to fix it (already tried disabling all the plugins). had to also add Show Real Visitor IP Instead of CloudFlare IPs • OpenLiteSpeed the ips to openlitespeed server. Put it to trusted ip only and add all the ips. After restart ls it worked finally.

1 Like