小编Xav*_*ion的帖子

WP rest api jwt auth

我想在这个插件中使用WP REST API auth:https://github.com/Tmeister/wp-api-jwt-auth

我在POST上使用此req获取令牌:http:// localhost/wp_rest/wp-json/jwt-auth/v1/token

但我无法发布发布mehod的请求:localhost/wp_rest/wp-json/wp/v2/posts

我收到错误403:

{
    "code": "rest_forbidden"
    "message": "You don't have permission to do this."
    "data": {
        "status": 403
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的标题中我有这个:

Authorization: Bearer
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3RcL3dwX3Jlc3QiLCJpYXQiOjE0NTAzNDEwMTgsIm5iZiI6MTQ1MDM0MTAxOCwiZXhwIjoxNDUwOTQ1ODE4LCJkYXRhIjp7InVzZXIiOnsiaWQiOiIxIn19fQ.rGNPsU4EocClWLYWaSDs1hDJMODszg-eKfqnKSEsiw0
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用localhost/wp_rest/wp-json/jwt-auth/v1/token/validate但我收到此错误:

{
    "code": "jwt_auth_no_auth_header",
    "message": "Authorization header not found.",
    "data": {
        "status": 403
    }
}
Run Code Online (Sandbox Code Playgroud)

任何的想法?

api rest wordpress jwt

7
推荐指数
1
解决办法
4719
查看次数

标签 统计

api ×1

jwt ×1

rest ×1

wordpress ×1