-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i authenticate using curl and get private entries ! #167
Comments
curl -XPOST -H 'Content-Type: application/json' -H 'access-token: e3xOfHG-SRkrAWwBS6MgHA' -H 'client: default' -H "uid: [email protected]" localhost:3000/YOUR_ROUTE |
i was trying this to get the access-token
then
it gave me do you think there's a problem with CSRF ? |
CSRF didn't occur with an API. Have you try to do the request in a |
This works for me :
So I get back the response (something like below, only important part) :
Then I can validate the token, using the client and token previously obtained from the above request, I do it like this :
The result :
|
So, it's working ? On Tue, Mar 3, 2015 at 5:38 PM Emir Ibrahimbegovic [email protected]
|
@nicolas-besnard I wasn't the one who reported it's not working. I just tried with the latest code |
@c0mrade sorry, didn't see it in my mail :) |
The worked well, final question can you give me an example for XPUT or XDELETE ! Thank you guys. |
You'll have to use the same curl request. Nothing change whatever your request type. |
Sorry but i'm trying
with the last client and access_token and it giving me 401 |
Did you do this request right after the login ? Because the |
Or you can try this in your initializer:
And your access token won't change for every request. |
@ACPK Unfortunately no, don't have phone apps just yet, but I think I did saw somebody having issues with it I think (should be somewhere in the open issues). |
No problem with iOS / Android app here.
|
Thanks @c0mrade your answer worked for me. |
hi i got correct output then i used get method for getting content using curl -XGET -v -H 'Content-Type: application/json' -H 'access-token: o5IgZro5E6khds_A-pqT5A' -H 'client: GgrHfydDnm7qnmiMD2qSZQ' -H "uid: VEYy0GeaEmp3TDvUIkfK0k9xbLtcu7" http://192.168.10.184:3000/api/products/find_by but i didn't get output i just got < HTTP/1.1 500 Internal Server Error
please help me |
I'm Searching over the web about how can i authenticate devise using curl and to get private entries !
Can anybody please help me about that?
The text was updated successfully, but these errors were encountered: