• Resolved robertasystyou

    (@robertasystyou)


    We are getting the following error when we attempt to fetch an authentication token. We are using WordPress Multisite 5.7.2.

    {
        "code": "api_api_bearer_auth_create_token",
        "message": "Error creating tokens.",
        "data": null
    }
    • This topic was modified 3 years, 9 months ago by robertasystyou.
    • This topic was modified 3 years, 9 months ago by robertasystyou. Reason: Fix code block
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author michielve

    (@michielve)

    I’m not yet sure why you get this error. It’s happening when the plugin wants to insert the access and refresh tokens after a successful login.

    Do you see the ‘wp_user_tokens’ table (maybe the ‘wp_’ prefix is something else in your case) with the following columns?

    – id
    – user_id
    – access_token
    – access_token_valid
    – refresh_token
    – refresh_token_valid
    – client_name

    Thread Starter robertasystyou

    (@robertasystyou)

    I see some. In our case the ‘wp_’ prefix as an id between it and the ‘user_tokens’ table, indicating which site it belonged to. I saw some tables for some site IDs that didn’t exist (probably sites that were imported then deleted for some reason during our migration to a new Bitnami stack).

    There wasn’t a table for the sites that we use the plugin for, so I attempted to create it manually with no luck.

    Thread Starter robertasystyou

    (@robertasystyou)

    Hey. I managed to finally get the plugin working again. I did so by:

    1. Deactivating the plugin.
    2. Deleting all the user_tokens tables from the database (We had recently migrated several sites to a single multisite server, so there were several tables when there should have only been one).
    3. Made sure that my .htaccess file had the SetEnvIf line instead of the RewriteRule (This wasn’t necessary on the old sites but seems to be necessary under our new Bitnami stack).
    4. Reactivated the plugin.

    Hope this helps someone else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error creating tokens’ is closed to new replies.