Hi can we get the custom field value of type passw...
# suitescript
m
Hi can we get the custom field value of type password?
n
In the Suitelet?
You will not get the text value of the password but an encrypted string.
m
Right... But how can I validate if I want
n
What validation do you require? Did you try the Sourcing & Validation tab on the custom field?
m
Email password validation in suitelet
Form or html
n
I guess you will need to store the username/password in the custom record. When the user enters the password in the suitelet, match it against the value in the custom record. The encrypted string should match if the password is same.
m
Excatly ... So how to match html password with custom record password
If we getValue then it gives encrypted string
My password is abcxyz in html in custom rec it would be ... Sgdyroegeidbfhjooqgbdogwhgyq like this
So how can I validate now
n
What if the field on the custom record is also set to encrypted?
ah scratch that misread
I wonder if you take the html value and write it in to another field on the custom record which is also encrypted, if you read the real password field plus your new field if you could compare them? A bit long winded but may work?
😅 1
🤔 1
n
Use the Suitelet password field, and not the HTML one.
Suitelet Password field match it with Custom record password field. Both will have the encrypted values. If the password is same, it should match.
m
I should be using html form @NickSuite
n
HTML Form integrated with NetSuite?
b
netuite's password fields are meant to be temporary
you need to save it somewhere else if you intend on using it later
please hash it if its an actual password
m
Hi @MJ and @NickSuite i am just wondering if there is a solution for this. I have created a custom field against the employee record and the type is ‘Password’. I believe NS will automatically encrypt this. What is the best way to encrypt a string the same way a string gets entered on the password field so that I can match if they are the same or not. NOTE: the string that will be encrypted comes from a mobile app that is calling a restlet to check if the username and password combination exists in NS. Two new custom fields are created for this.
n
@mjamosin in your case, you can use NetSuite webservice login request to verify the username/password.
m
@NickSuite I have general settings page on the app where user enters an actual NetSuite email and password, account ID, role etc.. to connect to the restlet. but each user of the app will be able to login to the app by entering username and password which is validated by checking if there is an employee record with username and password combination. The issue is I am not sure how to decrypt the password entered in NetSuite on the employee record or encrypt the password entered in the app to validate the login details.
n
"I have general settings page on the app where user enters an actual NetSuite email and password, account ID, role etc.. to connect to the restlet." Why can't you use this to verify the username/password? email,password, your NetSuite account ID, role of employee center.
m
The customer wants to use custom fields rather than their actual username and password.
n
Then tell them that it is not the correct way to use custom fields.
But.... what you can do is store the password in NetSuite using a plain-text field but using the N/crypto Module and create a Hash of that password. Now, using the same hashing algorithm, create a hash of the password that is input in the app and match the two hashes.
m
the app will have an offline mode as well therefore i can’t always rely on that method of authentication.. Ok I can try that, thanks for the help.