I code by Ruby:
management = Usergrid::Application.new "#{URL}"
management.login_credentials(CLIENT_ID, CLIENT_SECRET)
user = management["users"]["thodq"]["password"].entity
user.newpassword = "support"
user.save
like this: http://docs.apigee.com/app-services/content/setting-or-updating-password
But it not working.
Please help me
Solved! Go to Solution.
It work with code
app = Usergrid::Application.new "#{URL}" user = app['users/thodq/password'].put({oldpassword: "oldpass", newpassword: "newpass"})
@Dang Quoc Tho , Do you see any error ? BaaS calls needs to be authenticated using access token except sandbox app. Are you sending right credentials while updating user password ?
@Anil Sagar Thanks for your answer. But I don't understand what your mean. can you explain more detail.
It have error
RestClient::InternalServerError: 500 Internal Server Error /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/abstract_response.rb:48:in `return!' /root/workspace/ttapi/vendor/gems/usergrid_iron/lib/usergrid/core/resource.rb:170:in `handle_response' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:493:in `call' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:493:in `process_result' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:421:in `block in transmit' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:853:in `start' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:413:in `transmit' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:176:in `execute' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/request.rb:41:in `execute' /usr/local/rvm/gems/ruby-2.1.5@ttapi/gems/rest-client-1.7.2/lib/restclient/resource.rb:51:in `get' /root/workspace/ttapi/vendor/gems/usergrid_iron/lib/usergrid/core/resource.rb:126:in `get' /root/workspace/ttapi/vendor/gems/usergrid_iron/lib/usergrid/core/resource.rb:97:in `entity' /root/workspace/ttapi/app/api/resources/users.rb:110:in `block in <class:Users>'
It work with code
app = Usergrid::Application.new "#{URL}" user = app['users/thodq/password'].put({oldpassword: "oldpass", newpassword: "newpass"})