Pramod Gshet
Pramod Gshet

Reputation: 11

Token based authentication to call Netsuite API

Get Api of Netsuite is not working with oauth 1.0 from php generated authentication header, but Api works from Postman if we enable Oauth 1.0 in postman.

Postman generated Authorization Header :

OAuth realm="4819062_SB1",oauth_consumer_key="....oauth consumer kay.....",oauth_token=".....oauth token .....",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1532670855",oauth_nonce="KxFSDi",oauth_version="1.0",oauth_signature="UutS6YGFswBuc94%2FigPADywIdp8%3D"

Authorization Header using PHP :

Authorization :

OAuth oauth_signature="YAVtWB2W05JIPJeOALedNDUQQzE%3D", oauth_version="1.0", oauth_nonce="9acdd26cc3edde48628b9d60c901de46", oauth_signature_method="HMAC-SHA1", oauth_consumer_key=".....oauth consumer key...", oauth_token="........auth token.......", oauth_timestamp="1532671431", realm="4819062_SB1"

php generated authorization header is not working :

{
    "error": {
        "code": "INVALID_LOGIN_ATTEMPT",
        "message": "Invalid login attempt."
    }
}

Upvotes: 1

Views: 3308

Answers (1)

gingin
gingin

Reputation: 151

There are multiple reasons as to why we will encounter an Invalid Login Attempt Error. 

To know more details about the error, you can use the Login Audit Trail to track TBA tokens and users.

  1. Go to Setup > Users/Roles > User Management > View Login Audit Trail.
  2. Check the Use Advanced Search box
  3. Click the Results subtab.
  4. Add the following fields: DetailToken-based Access Token Name, and Token-based Application Name.
  5. Click Submit.

The Detail column displays error messages for any token-based authentication logins with a status of Failure. Please provide the error message on the details column so we can help you further.

Upvotes: 3

Related Questions