5

I am trying to call a Restlet from a User Event Script which returns Customer information using Token Based Authentication .

But I receive an user error which says header is not NLAuth scheme

I know this means that I have to use the NLAuth scheme , but why is it giving this error?

Here is the authorization header I am using

 var headers =  { 'Authorization': 'Oauth realm="XXXXX", oauth_consumer_key="XXXXX" , oauth_token="XXXXX", oauth_nonce="XXX",oauth_timestamp="XXXX", oauth_signature_method="HMAC-SHA1", oauth_version="1.0",oauth_signature="XXXXXXXXXX="',
                'content-type': 'application/json'
                };
quarks
  • 33,478
  • 73
  • 290
  • 513
Bharath
  • 213
  • 3
  • 14

3 Answers3

3

You need to capitalize the "a" in "Oauth" Oauth -> OAuth

3

Make sure that you are using the account ID for the realm and that it is formatted correctly. 12345_SB1 The underscore must be used if that applies to your account The letters must be capitalized.

Grant
  • 71
  • 1
  • 4
  • 1
    Thanks. I think this is the latest pattern for realm id in netsuite sandbox environment : ACCOUNTID_SB1 – JRichardsz Nov 30 '18 at 15:57
  • Correct the underscore is for sandbox accounts. If there is any doubt the account Id found under Setup > Company > Company Information . It has the correct format for now. – Grant Mar 31 '20 at 17:40
-4

Can you try this headers you will get solution

var headers = {
    "Authorization": "NLAuth nlauth_account='your account number',nlauth_email='login email' ,nlauth_signature='password'",
    "Content-Type":"application/json"
}
Nimeshka Srimal
  • 8,012
  • 5
  • 42
  • 57