Hi All, does someone has some experience with stor...
# suitescript
b
Hi All, does someone has some experience with storing passwords by using the
addCredentialField
? I have installed the SDN example but I can’t really grasp how it works. I also refactored it to my own requirements a bit. The issue now is that it uses a POST to https://httpbin.org/post as an example, but I can’t manage to create my own SuiteLet that does just exactly that as in, just returning the data it received. Also at line 7 in the snippet below you see an extra
credentials
option which is not documented in the HelpCenter. Bundle ID: 43518 The SDN Credentials SuiteApp application demonstrates the proper storage of external passwords in an encrypted form as per Netsuite guidelines. The application additionally demonstrates the process of consuming the generated credentials to access an external application.
b
I suspect that example is wrong
how did you learn of it?
Anyways, the first step is storing the password in NetSuite using a credential field. You pragmatically setup restrictions on the use of the credential when you create the field. When you set a value in the credential field, NetSuite automatically replaces it with the GUID. The https module can use the GUID like a string template: it will replace string instances of the GUID with the password in requests it sends
first step: did you need help creating the credential field
b
HI Battk, yes, I did that already It all works perfectly fine
the example works perfect, though I don’t want to post any data to httpbin.org but rather to my own Suitelet for example
b
thats actually still step one
credential fields limit which domains you can send the credential field
create your own credential field that restricts the domain to urls you choose (though your own suitelet would be an unusual choice)
b
ah okay
I am going to try to fit it into the current scripts I have.