生成_auth_cookie时出现Wordpress json api错误

Gaj*_*jas 1 wordpress wordpress-plugin

我遇到wordpress json Api的问题登录用户时.目前我正在使用下面列出的插件的Wordpress版本4.5.1:

以下是我遵循的步骤:

1)生成nonce

http://example.org/api/get_nonce/?controller=user&method=generate_auth_cookie

以下是回复:

{"status":"ok","controller":"user","method":"generate_auth_cookie","nonce":"4d080ff7b8"}
Run Code Online (Sandbox Code Playgroud)

2)生成Auth Cookie

http://example.org/api/user/generate_auth_cookie/?nonce=+4d080ff7b8&username=example&password=example

以下是回复:

{"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."}
Run Code Online (Sandbox Code Playgroud)

为什么我收到此错误?

and*_*tor 6

似乎JSON API UserJSON API Auth插件默认只允许通过https连接.

要关闭此设置,您应在请求中发送一个额外参数:

insecure=cool
Run Code Online (Sandbox Code Playgroud)

请尝试以下请求:

http://example.org/api/user/generate_auth_cookie/?nonce=+4d080ff7b8&username=example&password=example&insecure=cool
Run Code Online (Sandbox Code Playgroud)