PYTHON : How to authenticate using username/password?

I already connected mongodb and db[’_User’], I can query user info by ‘username’ column,
But… I can’t find column ‘password’ and I don’t know how to decode ‘_hashed_password’ column,
My Question is how to check ‘Password’ is correct ?

PS. I create desktop application using python and first i want to create user Authenticate System but i can’t get a password of user to check.

You will not be able to get the password in text format, only a hashed version is saved in the database.
After authentication (assuming that it is done with the sdk), you can check the session token in order to identify if the user was able to authenticate successfully. You can also look in parse server code if you really want to know how to validate that hash for the password, I don’t know what algorithm it is used for that hash.

Thanks for your reply, Can you guide me or share any idea if i want to use username/password of user in _User table for get ‘ethAddress’ my current code is


import pymongo

MONGO_HOST = “xxxxxxxxxxxxxx”
MONGO_PORT = xxxxx

client = pymongo.MongoClient(MONGO_HOST, MONGO_PORT)
user_table = client[‘parse’][’_User’]
myquery = { “username”: “[email protected]”}
user = user_table.find_one(myquery)

print(user)
print(user[‘ethAddress’])

Now use only username can get it but i need to compare the password is correct to.

you can try to search for a parse server library in python to see what you can use from there
parse server is used in a Moralis Server

Thank you for your advice, now i found the encrypt algorithm on the moralis doc, It’s my mistake didn’t see that well on first time read.

1 Like