I'm having problem with wordpress json Api When login the user. Currently I'm Using Wordpress version 4.5.1 with listed below plugin:

Here are the step I follow:
1) Generate nonce
http://example.org/api/get_nonce/?controller=user&method=generate_auth_cookie
Below is Response:
{"status":"ok","controller":"user","method":"generate_auth_cookie","nonce":"4d080ff7b8"}
2) Generate Auth Cookie
http://example.org/api/user/generate_auth_cookie/?nonce=+4d080ff7b8&username=example&password=example
Below is Response:
{"status":"error","error":"SSL is not enabled. Either use _https_ or provide 'insecure' var as insecure=cool to confirm you want to use http protocol."}
Why I'm Getting this error?
It seems that JSON API User and JSON API Auth plugins allow by default only connections over https.
In order to turn off this setting, you should send an extra parameter in the request:
insecure=cool
So try the following request:
http://example.org/api/user/generate_auth_cookie/?nonce=+4d080ff7b8&username=example&password=example&insecure=cool
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With