catalyst / moodle-webservice_restful

A REStful webservice plugin for Moodle LMS
GNU General Public License v3.0
36 stars 27 forks source link

Working with rest behind haproxy #17

Open joekutos opened 2 years ago

joekutos commented 2 years ago

I am trying to work with restful behind haproxy version 2.4 but i am getting the error

_{"exception":"moodleexception","errorcode":"noauthheader","message":"No Authorization header found in request sent to Moodle"}

This is probably because Haproxy is not forwarding the header to moodle!! Tried adding the header in the backend configuration but still not getting the solution

http-request set-header Authorization "HHHhdasdashdahs88832422hhththadas"

This doesnt seem to solve the issue. A solution to this would be appreciated

szvarhegyi commented 2 years ago

Hello joekutos,

I have a same issue, but i make a pull request. You can configure a secondary authorization param name (eg.: token) and this not will be removed from header. This is my pr: https://github.com/catalyst/moodle-webservice_restful/pull/19