Hello guys, Does anyone know of a way to securely ...
# suitecommerce
k
Hello guys, Does anyone know of a way to securely validate calls from SuiteCommerce to a Suitelet? I know that SuiteCommerce internally does it through its API, but with external Suitelets how would it be? I only know by URL, but there must be some other better way, without using NLAuth or Token, it would be executed by the Customer
p
well, one thing you can do and avoid all issues is just calling the suitelet via the frontend itself.
the other option can be forwarding all headers from the request to the suitelet (by sending request.getAllHeaders() to nlapiRequestUrl(url, postData, headers). SCA does it on some very edge cases, on cancelling return auths and orders.
k
Im sending all the headers from the ServiceController to the Suitelet, but how can I validate this headers ?
p
you don't, you just deploy the suitelet only to customers.
That being said, it's dangerous and it has ugly edge cases.
If it's for an isolated service for a logged in user it will work fine i guess.
k
Interesting about the deploy. Do you know any way to make it safer?
Just logged in customers
p
Calling the suitelet directly is not an option?
yoursite.com/suiteletUrl.nl should work and keep the session.
k
I think its not working You do not have privileges to view this page 😕
k
@Kevin Eimer, is your suitelet available without login?
k
Yes it is