WordPress REST API key Authentication method involves the REST APIs access on validation against the API key(token). Each time a request to access the API will be made, the authentication will be done against the key(token), and on the basis of the verification of the API key(token), the resources for that API request will be allowed to access.
Download And Installation
- Log into your WordPress instance as an admin.
- Go to the WordPress Dashboard -> Plugins and click on Add New.
- Search for a WordPress REST API Authentication plugin and click on Install Now.
- Once installed click on Activate.
Step 1: Setup WordPress REST API Authentication plugin
- Select REST API Authentication method →API Key and click on Save Configuration.
- Once you save the configuration, under the Universal API key section you will get the option to Generate New Token. Click on Generate New Token button. This token will expire when you generate a new token.
- Once you generate the API Key(token), you can use it to secure your WordPress REST APIs. You need to pass it to the header while making the REST API request as shown in the step below.
- Users who have this token can access the REST API as shown below.
Check out the developer documentation for more details.
Request: GET https://<domain-name>/wp-json/wp/v2/posts
Header: Authorization : Bearer <token>
Sample request: GET https://<domain-name>/wp-json/wp/v2/posts
Header: Authorization : Bearer kGUfhhzXZuWisofgnkAsuHGDyfw7gfhg5s
Mail us on email@example.com for quick guidance(via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.