I need to log Django admin users in 3ed party authentication service. For that I need plane password without hashing. Here I used pre_save signal. That approach works well when I create an API endpoint for registration. But when I create an admin user from Django it always comes with defalut hashed password.
Any idea how to get the plane password?
You have to access the
requestobject to get that data.You can use
@hooks.register('before_create_user')to register a method to run before creating the user and get the password usingpassword=request.POST['password1']. Keep in mind that, this hook runs when form loaded and also when form submitted. To get the password, you need to run this only when form submitted.