node-wpapi icon indicating copy to clipboard operation
node-wpapi copied to clipboard

How to handle authentication when using Duo Authentication?

Open IonicaBizau opened this issue 6 years ago • 2 comments

We use Duo Authentication and disabled it for a specific user, but want to keep it for the other users.

I wasted many hours of debugging finding out why I get success response from WordPress, but the post was not being created.

It was because the JSON.parse in the try-catch with its hidden error. Maybe there should be a warning or something similar if the the response is not JSON-parsable.

How to handle authentication when using Duo Authentication?

IonicaBizau avatar Oct 28 '19 17:10 IonicaBizau

I fixed this by using the Application Passwords plugin. That will bypass the Duo Authentication, but the error was hidden in deeply, because of the try-catch + JSON.parse.

IonicaBizau avatar Nov 13 '19 23:11 IonicaBizau

https://github.com/WP-API/node-wpapi/blob/f4a23a958007f5b7e7381e4fd70fa62b78470bdf/superagent/superagent-transport.js#L91

IonicaBizau avatar Jan 01 '20 19:01 IonicaBizau