[SOLVED] REST query result on password fields

Hi Team,

Just upgraded to v7 and noticed that my rest queries are receiving json files with ****** in the password fields. Is there a way i can get the password in text, how to read password field in doctypes where fields are flagged as password?

I have a python script ussing the frappe rest client to integrate with erpnext but is failing now cause the data coming back is ****** in stead of the password I need for the rest of my code to run.

regards
Hemant

1 Like

I have the exact same problem ( Frappe.db.get_value for password field returns '****' ). Any help would be greatly appreciated.

Cheers
Maxi

Hi ppd,

It looks like password fields are stored differently now then in v6. I trying to figure this out myself and I noticed that password fields are stored elsewhere in the db… the single doctype that i created no longer has the password fields. Somehow they seemed to be stored somewhere else.

Not sure if I missed a post regarding this?

Can anyone share how to read password fields now?

thnx

regards
Hemant

edited: my bad, they are in the database but also show with *****, this is a good design personally, but just need to know how to view them now…thnx

Hi ppd,

for now I have changed te field type to data and resaved the data in that doctype so that my scripts will work until we get some feedback from the community regarding the password field type and how to use them in v7.

regards
Hemant

1 Like

Hi Maxi,

password fields are now stored in __Auth table. What I did is created a method that decrypts the fields I need using the password.py import

example:
from frappe.utils.password import get_decrypted_password

def getMyServiceSettings():
data =frappe.get_doc(“My Services Settings”)
data.password = get_decrypted_password(‘My Services Settings’, ‘My Services Settings’, ‘password’, False)
return data

this worked for me, not sure if there is another way in Frappe but this is what I figured out running around the code. You will need access to the server to create the script if your init.py file for your app.

Hope this helpds

regards
Hemant

11 Likes

Am doing what you are doing here but when ever the script runs, it logs out the user