In the past I have automated the configuration of the WP-Matomo (WP-Piwik) plugin by getting the token_auth string for the user using a MySQL query and then setting the required variables using the WordPress CLI (see the Ansible tasks here).
However with Matomo 4.x the token_auth string is encrypted in the database so this won’t work.
Checkout UsersManager.getTokenAuth method to get token.
However that method is not in the list of UsersManaged methods, is there an undocumented method that can be used or is some PHP now needed to access the token_auth for a user?
We also have been using token_auth for matomo dashboard to embed in iframe but now in matomo 4.6.0 it looks there is no way to get token_auth either through MySQL query or matomo API .
Not really, but I worked around it by keeping a copy of users passwords, which breaks when users change them, it’s not ideal, it’s all in this Ansible role: