Server does not receive the Authorization: Bearer header
I am facing an issue where apache and PHP on my server does not pass the Authorization: Bearer header for unknown reason
following is my server parameters where 'REDIRECT_HTTP_AUTHORIZATION' and
'HTTP_AUTHORIZATION' not been passed:
here is my post request along with token in Authorization: Bearer:
I have tried all the possibilities, but don't know what is really required for server configuration. Please i need your help to get this sorted out.
Array
(
[PATH] => /usr/local/bin:/usr/bin:/bin
[TZ] => America/New_York
[REDIRECT_HANDLER] => application/x-httpd-ea-php55
[REDIRECT_STATUS] => 200
[UNIQUE_ID] => WWpJVpKPRYrF2yRGByFSZQAAAAQ
[SCRIPT_URL] => /tstapi/public/todos
[SCRIPT_URI] => https://example.com/tstapi/public/todos
[HTTPS] => on
[HTTP_HOST] => example.com
[HTTP_USER_AGENT] => curl/7.43.0
[HTTP_ACCEPT] => */*
[CONTENT_TYPE] => application/json
[CONTENT_LENGTH] => 40
[HTTP_X_HTTPS] => 1
[SERVER_SIGNATURE] => Apache/2.4.25 (cPanel) OpenSSL/1.0.2k mod_bwlimited/1.4 Server at example.com Port 443
[SERVER_SOFTWARE] => Apache/2.4.25 (cPanel) OpenSSL/1.0.2k mod_bwlimited/1.4
[SERVER_NAME] => example.com
[SERVER_ADDR] => 198.38.xx.xxx
[SERVER_PORT] => 443
[REMOTE_ADDR] => 121.100.xx.xx
[DOCUMENT_ROOT] => /home/kweekly/public_html
[REQUEST_SCHEME] => https
[CONTEXT_PREFIX] => /cgi-sys
[CONTEXT_DOCUMENT_ROOT] => /usr/local/cpanel/cgi-sys/
[SERVER_ADMIN] => webmaster@example.com
[SCRIPT_FILENAME] => /home/kweekly/public_html/tstapi/public/index.php
[REMOTE_PORT] => 55634
[REDIRECT_URL] => /tstapi/public/index.php
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => POST
[QUERY_STRING] =>
[REQUEST_URI] => /tstapi/public/todos
[SCRIPT_NAME] => /tstapi/public/index.php
[ORIG_SCRIPT_FILENAME] => /usr/local/cpanel/cgi-sys/ea-php55
[ORIG_PATH_INFO] => /tstapi/public/index.php
[ORIG_PATH_TRANSLATED] => /home/kweekly/public_html/tstapi/public/index.php
[ORIG_SCRIPT_NAME] => /cgi-sys/ea-php55
[PHP_SELF] => /tstapi/public/index.php
[REQUEST_TIME_FLOAT] => 1500137814.08
[REQUEST_TIME] => 1500137814
[argv] => Array
(
)
[argc] => 0
[DB_NAME] => kweekly_api
[DB_USER] => kweekly_apidb
[DB_PASSWORD] => xxxxxxxx
[DB_HOST] => localhost
[JWT_SECRET] => supersecretkeyyoushouldnotcommittogithub
)
Array
(
[Host] => example.com
[User-Agent] => curl/7.43.0
[Accept] => */*
[Content-Type] => application/json
[Content-Length] => 40
[X-Https] => 1
)
here is my post request along with token in Authorization: Bearer:
curl "https://example.com/tstapi/public/" --request POST --include --insecure --header "Authorization: Bearer $TOKEN" --header "Content-Type: application/json" --data '{ "title": "Test the API", "order": 10 }'I have tried all the possibilities, but don't know what is really required for server configuration. Please i need your help to get this sorted out.
Please sign in to leave a comment.
Comments
0 comments