-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OJS 3.4] Document CGIPassAuth setting for API Authorization #9320
Comments
Unable to produce the issue in the latest stable 3.4.0-3 for local testing . Both the Authorization header and apiToken query param works fine . @kswro I see that you are using insomnia api client app for testing and same for me . see the screenshot below do you see any error in the error log file ? |
Hello @touhidurabir Thank you for your reply. I didn't find any error logs on PHP and Apache. However, I have found a solution to this problem. From this page I learned that various Apache modules will strip the Authorization header, usually for "security reasons". So, based on the same source, I added the line below to the .htaccess file in my OJS public folder and now I can connect to the REST API via authorization header: Apart from the above lines, I also tried using other alternatives as below which also solved the problem.
Based on what I experienced (and many others), do you think the above problems and solutions can be added to the documentation? FYI, I'm using Apache >2.4.54 and PHP 8.2 (FPM) in this test. |
@kswro I will discuss with other dev team members to see if it is possible to add few details regarding this in the doc . |
You should really add this note because i also experienced the same problem. If i didn't find this post i'd be spending a lot of time investigating what's going on. GG @kswro. |
PRs for review:
@ewhanson are you the best person to review/merge this change to the API docs? I can also make the PR to the docs hub once approved. Here's a screenshot of the change in my IDE's preview tool for easier review, where I've added the "Connection Issues" section: |
Describe the bug
I am unable to authenticate to the REST API via the Authorization Header as in the page https://docs.pkp.sfu.ca/dev/api/ojs/3.4#tag/Authentication (403 Forbidden).
But, if authentication uses the apiToken parameter query, the connection to the REST API can be established (200 OK).
To Reproduce
Steps to reproduce the behavior:
What application are you using?
OJS 3.4.0-3
Additional information
Tested on production server and new (fresh) local installation.
The text was updated successfully, but these errors were encountered: