Thursday, April 30, 2015

Django oauth2 encrypt password

I am following instructions under

I am having trouble with creating a user with encrypted password.

I am able to create a user with the call

curl -H "Authorization: Bearer lXbYKZqnPeqOyYaHyB3EOAvcMny13j" -X POST -d"username=foo1&password=bar1&first_name=foo1&" http://${endpoint}/users/


As you can see, it is creating a new user but the password is in clear text.

As a result, I am unable to get a user token

curl  -X POST -d "grant_type=password&username=foo1&password=bar1&scope=read" -u"${clientid}:${clientsecret}" http://${endpoint}/o/token/

{"error_description": "Invalid credentials given.", "error": "invalid_grant"}(env)

I sort of found a workaround. I can go in as admin to the console and change the user password manually. This seem to store the password as encrypted. How do I sole this via api calls?

I am sure I am missing something. Appreciate if someone could unblock me.

- Shekar

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment