You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to add Authentication to the api created as per example, but I can't find the way to send email and password in order to authenticate, it always responds "Unauthorized":
Using rocket_pants 1.13.0
app/controllers/api/v1/users_controller.rb
classApi::V1::UsersController < RocketPants::BaseincludeDevise::Controllers::Helpersbefore_filter:authenticate_user!version1defindexexposeUser.all# Not what we'd actually do, of course.endend
curl -i -X GET -d "user[email][email protected]&user[password]=1234" 'http://localhost:3000/1/users'
The answer I get, from development.log is:
Started GET "/1/users" for 127.0.0.1 at 2015-08-04 03:12:31 +0200
Processing by Api::V1::UsersController#index as
Parameters: {"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}, "version"=>"1"}
Completed 401 Unauthorized in 0ms
I tried even using CocoaRestClient in which I filled the HTTP Basic Auth or HTTP Digest Auth, but still I get:
Do I need to add something somewhere? Am I missing something in the request? I feel a bit lost, since there seems to be no clear documentation on the web about the integration between Rocket Pants and Devise, and how to use the integrated api...
Thanks for the answer,
Gabriele
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to add Authentication to the api created as per example, but I can't find the way to send email and password in order to authenticate, it always responds "Unauthorized":
Using rocket_pants 1.13.0
app/controllers/api/v1/users_controller.rb
config/routes.rb
This is the curl line I use for testing:
The answer I get, from development.log is:
I tried even using CocoaRestClient in which I filled the HTTP Basic Auth or HTTP Digest Auth, but still I get:
Do I need to add something somewhere? Am I missing something in the request? I feel a bit lost, since there seems to be no clear documentation on the web about the integration between Rocket Pants and Devise, and how to use the integrated api...
Thanks for the answer,
Gabriele
The text was updated successfully, but these errors were encountered: