Create a custom password field

Hi,
I have created a custom doctype that holds a users details for an app. I want to be able to add and md5 password field to the list of fields. Is there a way i can encrypt that field using custom script?

There’s already a password field in frappe that encrypts the password using a key.

Thank you very much @vjFaLk for the answer, i had no ideas the password field encrypts the password.

1 Like

@vjFaLk Sorry to bother you, but i am fetching the password field and it comes as “*******”, with this i can’t compare passwords. Do you have an idea how i can work with this password field via restful api integration?

There’s a function in frappe that you call like this : frappe.get_password('fieldname'). Make sure the fieldname is in quotes. That will basically get you the password in raw text. But this is within frappe itself, and I don’t think there’s a way to do a GET request to get a password field properly. You can write a function that would return the data with the raw text password and then call it though.

2 Likes