Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API not working on PROD environment (SSL enabled), getting the following error when trying to access the endpoints via oauth
OAuthException Object
(
[message:protected] => Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)
[string:Exception:private] =>
[code:protected] => 401
[file:protected] => <DOCROOT_PATH>/sites/all/modules/oauth_client/oauth_client.module
[line:protected] => 83
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => <DOCROOT_PATH>/sites/all/modules/oauth_client/oauth_client.module
[line] => 83
[function] => fetch
[class] => OAuth
[type] => ->
[args] => Array
(
[0] => <PRODUCTION_SERVER>//profile/node.json
[1] => Array
(
)
[2] => POST
)
)
[1] => Array
(
[function] => oauth_client_page_callback
[args] => Array
(
)
)
[2] => Array
(
[file] => <DOCROOT_PATH>/includes/menu.inc
[line] => 527
[function] => call_user_func_array
[args] => Array
(
[0] => oauth_client_page_callback
[1] => Array
(
)
)
)
[3] => Array
(
[file] => <DOCROOT_PATH>/index.php
[line] => 21
[function] => menu_execute_active_handler
[args] => Array
(
)
)
)
[previous:Exception:private] =>
[lastResponse] => ["Token not found"]
[debugInfo] => Array
(
[sbs] => POST&https%3A%2F%2<DOMAIN>%2F%2Fprofile%2Fnode.json&oauth_consumer_key%<KEY>%26oauth_nonce%<PARAM>.89849805%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1455167746%26oauth_token%<TOKEN>%26oauth_version%3D1.0
[headers_recv] => HTTP/1.1 401 Unauthorized : Token not found
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Content-Type: application/json
Date: Thu, 11 Feb 2016 05:15:47 GMT
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Server: nginx
Vary: Accept-Encoding
WWW-Authenticate: OAuth realm="<DOMAIN>"
X-AH-Environment: prod
X-Content-Type-Options: nosniff
X-Drupal-Cache: MISS
X-Request-ID: <REQUEST_ID>
Content-Length: 19
Connection: Close
[body_recv] => ["Token not found"]
)
[xdebug_message] =>
OAuthException: Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) in <DOCROOT_PATH>/sites/all/modules/oauth_client/oauth_client.module on line 83
)
Comment | File | Size | Author |
---|---|---|---|
#3 | 2666666-3.patch | 598 bytes | Ankit Agrawal |
#2 | 2666666-1.patch | 598 bytes | Ankit Agrawal |
Comments
Comment #2
Ankit Agrawal CreditAttribution: Ankit Agrawal as a volunteer commentedThis patched resolved the issue on Acquia PROD environment.
Comment #3
Ankit Agrawal CreditAttribution: Ankit Agrawal as a volunteer commentedUpdated the filename with proper comment number.
Comment #4
Ankit Agrawal CreditAttribution: Ankit Agrawal as a volunteer commentedComment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI got this error:
Notice: Undefined index: HTTP_X_FORWARDED_PROTO in OAuthRequest::from_request() (line 275 of oauth/lib/OAuth.php) which is the line inserted.
I am using apache2 server