Sunday, September 16, 2018

SuiteSignOn (Outbound SSO) > HTTP Error code - 400 Bad Request


What do I check when I get HTTP Response Code 400 Bad Request?


This applies only to the Request Token and Access Token requests.

Error detail given is either one of the following:

    * Unsupported parameter

    * Unsupported signature method

    * Missing required parameter

    * Duplicated OAuth Protocol Parameter


When getting the HTTP response, inspect the body for a more specific error message.

  • HTTP Error code 400 is returned in the event that one of the following takes place:
    • Unsupported parameter
      •  Make sure that the parameters passed are valid for the request/response.
      •  An unsupported OAuth version is specified
      • OAuth Protocol Parameters are defined as Parameters with names beginning with oauth_.
      • Netsuite specific parameters MUST NOT begin with oauth_.

VALID OAuth Protocol Parameters are sent in the Authorization header the following way:

  1. Parameter names and values are encoded by :

·         All parameter names and values are escaped using the percent-encoding (%xx) mechanism.

·         Characters not in the unreserved character set MUST be encoded.

·         Characters in the unreserved character set MUST NOT be encoded.

·         Hexadecimal characters in encodings MUST be upper case.

·         Text names and values MUST be encoded as UTF-8 octets before percent-encoding them.

  1. For each parameter, the name is immediately followed by an '=' character (ASCII code 61), a '"' character (ASCII code 34), the parameter value (MAY be empty), and another '"' character (ASCII code 34).
  2. Parameters are separated by a comma character (ASCII code 44) and OPTIONAL linear whitespace.

For example:

  • Authorization: OAuth realm="",
  • oauth_consumer_key="0685bd9184jfhq22",
  • oauth_token="ad180jjd33cd918",
  • oauth_signature_method="PLAINTEXT",
  • oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
  • oauth_timestamp="1191242090",
  • oauth_nonce="hsu94j3884jdopsl",
  • oauth_version="1.0"
  • Unsupported signature method
    • Signature Method should always be PLAINTEXT
    • This is the ONLY signature method supported by Netsuite as of the moment.
  • Missing required parameter     Each OAuth Protocol Parameters are REQUIRED unless otherwise noted.
  • Duplicated OAuth Protocol Parameter Each OAuth Protocol Parameter MUST NOT appear more than once per request.

No comments:

Post a Comment