Programmatically obtaining OAuth Token (for testing)

This is for the FediTest.org project, which develops a test suite for the Fediverse. We are working to integrate a configuration of WordPress (base + ActivityPub + this plugin) that can participate in automated ActivityPub protocol testing. There are lots of parts to this, and one of them is that we want FediTest tests to be able to use the Mastodon API that you implemented (yay!) to cause WordPress to take certain actions, like create a post or check that a follower has arrived. To do that, we need an OAuth token, and we are wondering whether there is a way to obtain such a token in an automated fashion that does NOT require a user going through the UI.

To get such a token, we are willing to take unnatural acts :-), all the way to inserting a value directly into the SQL database. In the context of FediTest, assume we have root access to the machine that runs WordPress.

To be clear, we are not asking for functionality that should ever be run in production. We are asking for a “hack” the FediTest can use in a disconnected container environment, as root, on the same machine as WordPress.

Wouldn’t be surprised if it was as simple as a single INSERT, or calling a single PHP script. Pointers appreciated…

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer