2

I need to request a new password via services.

I used the URL: <endpoint>/user/password?args['name']=test2

but it returns Access denied for user anonymous

It's supposed to be used by non authenticated users so why does it return this error?. What am I doing wrong here? What is the URL should I use?

2 Answers 2

4

This feature was added with the resolution of this issue:

To use this resource, make a POST to:

?q=rest/user/request_new_password.json

...and send along a name

name=john

...or e-mail address:

[email protected]
8
  • Hi tyler, why does it work for me but only if i remove '?q=rest' ? and it doesn't send an email it just returns [true] (no mail in the name = @)
    – Mitch
    Aug 16, 2015 at 14:56
  • @Mitch replace "rest" with the name of your endpoint. It returns [true] if the request was successful, i.e. it tried to send an e-mail. Aug 17, 2015 at 12:55
  • yes @tyler that's right for returning 'true' but it doesn't send any mail to the e-mail address i entered as name
    – Mitch
    Aug 17, 2015 at 13:07
  • is it because i'm working on localhost ?
    – Mitch
    Aug 17, 2015 at 13:19
  • @Mitch yes localhost usually isn't configured by default to be able to send e-mails. That's something that I've never personally done, and have always migrated such code to a dev/live site for e-mail testing. Aug 17, 2015 at 13:42
1

According to this sandbox (from two years ago):

Services module provides integration with User module but it does not provide the service to request a new password in case a user has forgotten it.

The sandbox claims to fix that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.