[New post] How to Get Authentication Working Using the Node WPApi Package
Dwayne posted: " If you are working with WordPress version 5 and up, you might be using the REST API. I love the in-built REST API WordPress provides, especially for creating applications on top of WordPress. The Node WPApi package makes this a breeze, especially when"
If you are working with WordPress version 5 and up, you might be using the REST API. I love the in-built REST API WordPress provides, especially for creating applications on top of WordPress.
The Node WPApi package makes this a breeze, especially when it comes to authentication based actions.
My first test with this package was creating a new post, and I got this error message:
Sorry, you are not allowed to create posts as this user.
I was confused at first because I entered the correct username and password for my WordPress installation. Well, as you will discover, WordPress won't just allow you to perform authentication-based requests using your standard credentials.
Once you are logged in, you need to go down to the application passwords section and generate a new password in your user profile section.
Once you enter a descriptive label, you will be presented with a randomly generated password. You will not be able to retrieve this, so copy and paste it somewhere. You will then use your currently logged in username as your username value and your newly generated application password as your password (instead of the password you use when you log in).
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.