Hey all, I am facing issues in implementing token ...
# suitescript
p
Hey all, I am facing issues in implementing token based authentication in my RESTlets. I have set up all the required information. - enabled TBA - Created the Integration - Added TBA Login with Token permissions to a Role under my User Account - Generated a TBA Token I followed generated the header that I've added to my Postman Request (OAuth 1.0), but I am continuously getting a below error. { "error": { "code": "INVALID_LOGIN_ATTEMPT", "message": "Invalid login attempt." } } Also checked into the Login audit trail & it was showing an error ‘InvalidSignature’. I am passing the correct parameter but still not able to find the exact root cause. Do we have to encode keys/token/secret keys before sending it to the postman? if yes then please help me with the steps to follow.
b
no encoding of the keys required when using postman
general troubleshooting is regenerate both pairs of keys, make sure you set the correct fields in postman
be extra sure the realm matches account id
and the obvious get the url correct
p
Thanks battk. I had tested by regenerating a new set of keys but still getting the same error. apart from this also checked the account id which is copied from Setup > Company > Company Information page. Is there any other configuration at Netsuite level to be in place for RESTLet?
u
Invalid Login attempt has multiple reasons why the attempt fails. You might want to check the login audit trail to review the more specific reason why thge login fails e.g. invalid token or invalid consumer id
p
Thanks Chris Arbon . While going through the Audit trail, I found that the Login Audit trail is showing 'InvalidSignature' error message. this indicates that an incorrect signature has been passed while calling RESTlet as per Netsuite documentation. I have checked twice for the keys by generating it again but still getting the same error message. I didn't found any detailed description about the error except 'invalidSignature'. Please let me know, if there are any other ways to get the exact error message with a detail description.
b
there isn't really much more you can get incorrect with postman. This is what a working request looks like, using environmental variables
p
Thanks battk for your valuable input. I have tried with Postman app & it is working fine. I was using Postman web with the same set of keys & URL but it was showing the same error in Postman web whereas in postman App it is working.