Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress json api error while generate_auth_cookie

Tags:

wordpress

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?

like image 637
Gajjar Tejas Avatar asked Nov 17 '25 12:11

Gajjar Tejas


1 Answers

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
like image 122
andreivictor Avatar answered Nov 19 '25 02:11

andreivictor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!