Gajjar Tejas
Gajjar Tejas

Reputation: 188

Wordpress json api error while generate_auth_cookie

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?

Upvotes: 3

Views: 5581

Answers (1)

andreivictor
andreivictor

Reputation: 8461

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

Upvotes: 8

Related Questions