WPIntell

Source evidence

Looking for this in Ages

JSON API Auth · review · 2014-03-29T12:37:00+00:00

praisesentiment
highseverity
0.78relevance
9replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

review · 5 stars
kisekicyd unresolved
Thank you for this.. My only problem is that I dont know how to used it.. any tutorial you can give me?.. I mean step by step tutorial.. BTW thanks for this, because im building a native app that will use wordpress website as a content management only and the app will just pull the data on it… It is very straight forward as mentioned in FAQs. Once cookie is generated successfully, you will get cookie that you can then use in other controllers/methods for user authentication. Steps are: Create ‘nonce’ by using core get_nonce method http://your-domain/api/get_nonce/?controller=auth&method=generate_auth_cookie You can then use ‘nonce’ value to generate cookie. http://your-domain/api/auth/generate_auth_cookie/?nonce=f4320f4a67&username=Catherine&password=password-here Use cookie like this with your other controller calls: http://your-domain/api/contoller-name/method-name/?cookie=Catherine |1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd Hope it helps.. Hello, First step is okay for me. Second step, I get this return : {“status”:”error”,”error”:”Unknown controller ‘auth’.”} Here is my url : http:/my-domain-name/api/auth/generate_auth_cookie/?nonce=6aa27a411c&username=collaborateur_wk&password=061bfabc4eedf846684f8044d718bb36 Where : “6aa27a411c” is the nonce returned in the first step, and the password is the md5 crypted password of the user “collaborateur_wk” I guess this is because I still don’t understand exactly how to use it, that’s why I post here as a reply. Thanks for you further answer. password is not encrypted. if you want to md5 it, you can but change the code inside plugin. I will also make it md5 encrypted password in the next release. Okay, but I tried already with the password not encrypted (actually, this was my first guess). But still it does not work. I thought It’s because the user is only subscriber, I tried also with an admin user, but doesn’t work either. Some details : first step : http://domain-name/api/get_nonce/?controller=auth&method=generate_auth_cookie received : {“status”:”ok”,”controller”:”auth”,”method”:”generate_auth_cookie”,”nonce”:”2b7e7fe054″} second step : http://domain-name/api/auth/generate_auth_cookie/?nonce=2b7e7fe054&username=user_benj&password=password-not-encrypted Any idea ? Thanks again. have you installed any capthca code? may be that is stopping it from providing valid cookie. Otherwise it should work, there is nothing complex. No, I don’t use captcha for authentication. My website is restricted on logged in user and ip address. But my IP address is unrestricted then I guess, it’s not the problem. What kind of other informations could you need to help me ?… I will try to use your plugin on a blank website… instead of my website, already settled. Ali Qureshi thank you and i will looking forward for the release with the md5.. @bperney can i have the full code so i can copy it with my app?.. just the login with dummy user and password will do.. Thanks.. @kisekicyd Actually, I didn’t write the code in my app yet. Just used a browser to go to the right URL with parameters and tried to generate cookies. Can it be a problem ? Hi I had the same {“status”:”error”,”error”:”Unknown controller ‘auth’.”} error myself. Perhaps you want to check your WordPress site Settings->JSON API. Then you need to activate the JSON-API Auth controller (it is not activated by default as far as I know, in contrast to the core controller. Hope this helps

Comments

9 shown
Ali Qureshi 2014-03-29T13:08:00+00:00

It is very straight forward as mentioned in FAQs. Once cookie is generated successfully, you will get cookie that you can then use in other controllers/methods for user authentication. Steps are: Create ‘nonce’ by using core get_nonce method http://your-domain/api/get_nonce/?controller=auth&method=generate_auth_cookie You can then use ‘nonce’ value to generate cookie. http://your-domain/api/auth/generate_auth_cookie/?nonce=f4320f4a67&username=Catherine&password=password-here Use cookie like this with your other controller calls: http://your-domain/api/contoller-name/method-name/?cookie=Catherine |1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd Hope it helps..

bperney 2014-04-08T10:18:00+00:00

Hello, First step is okay for me. Second step, I get this return : {“status”:”error”,”error”:”Unknown controller ‘auth’.”} Here is my url : http:/my-domain-name/api/auth/generate_auth_cookie/?nonce=6aa27a411c&username=collaborateur_wk&password=061bfabc4eedf846684f8044d718bb36 Where : “6aa27a411c” is the nonce returned in the first step, and the password is the md5 crypted password of the user “collaborateur_wk” I guess this is because I still don’t understand exactly how to use it, that’s why I post here as a reply. Thanks for you further answer.

Ali Qureshi 2014-04-08T10:28:00+00:00

password is not encrypted. if you want to md5 it, you can but change the code inside plugin. I will also make it md5 encrypted password in the next release.

bperney 2014-04-08T13:23:00+00:00

Okay, but I tried already with the password not encrypted (actually, this was my first guess). But still it does not work. I thought It’s because the user is only subscriber, I tried also with an admin user, but doesn’t work either. Some details : first step : http://domain-name/api/get_nonce/?controller=auth&method=generate_auth_cookie received : {“status”:”ok”,”controller”:”auth”,”method”:”generate_auth_cookie”,”nonce”:”2b7e7fe054″} second step : http://domain-name/api/auth/generate_auth_cookie/?nonce=2b7e7fe054&username=user_benj&password=password-not-encrypted Any idea ? Thanks again.

Ali Qureshi 2014-04-08T14:00:00+00:00

have you installed any capthca code? may be that is stopping it from providing valid cookie. Otherwise it should work, there is nothing complex.

bperney 2014-04-08T16:51:00+00:00

No, I don’t use captcha for authentication. My website is restricted on logged in user and ip address. But my IP address is unrestricted then I guess, it’s not the problem. What kind of other informations could you need to help me ?… I will try to use your plugin on a blank website… instead of my website, already settled.

kisekicyd 2014-04-08T18:55:00+00:00

Ali Qureshi thank you and i will looking forward for the release with the md5.. @bperney can i have the full code so i can copy it with my app?.. just the login with dummy user and password will do.. Thanks..

bperney 2014-04-09T07:49:00+00:00

@kisekicyd Actually, I didn’t write the code in my app yet. Just used a browser to go to the right URL with parameters and tried to generate cookies. Can it be a problem ?

lytridic 2014-05-16T17:36:00+00:00

Hi I had the same {“status”:”error”,”error”:”Unknown controller ‘auth’.”} error myself. Perhaps you want to check your WordPress site Settings->JSON API. Then you need to activate the JSON-API Auth controller (it is not activated by default as far as I know, in contrast to the core controller. Hope this helps