Bearer Token Authentication

Viewing 3 posts - 1 through 3 (of 3 total)
#194773

Roco Montgomery
Participant

Hello,

I am currently testing the WPDM API before purchasing the pro version.

After some struggles, I have managed to authenticate using Basic Authentication. To make it work I had to make changes to the htaccess file.

Now I want it to work using Bearer Token.

I am running the following command:

curl -X GET \
https://host.com/wp-json/wpdm/v1/packages \
-H ‘Authorization: Bearer 65d67afbbXXXX’ \

I get the following response:

{“code”:”rest_forbidden”,”message”:”You cannot view the post resource.”,”data”:{“status”:401}}%

A few questions:
– Is bearer token authentication still supported?
– If so, do I need to download additional plugins for it to work? I only have the WPDM plugin and the WPDM Rest API addon
– Why is it not working? Could it also be a problem with the htaccess file? If so in what way should I modify it?

I saw one the moderators suggest the following:

“REST API is working now. Some Apache module was removing the authorization header from the request. I had to add CGIPassAuth On in your .htaccess file to allow the bearer token in the header.”

I tried adding “CGIPassAuth On” but it made no difference.

Please help! ๐Ÿ™‚

#194799

Tahasin
Moderator

Hello, Roco

I hope this message finds you well and sorry for the inconvenience.
Could you please confirm whether you’ve added this rule into your .htaccess file?

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Thank you!

#194800

Tahasin
Moderator

If not kindly do so, this should solve your issue.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.