Support » Plugin: Advanced Custom Fields: Font Awesome Field » API: Could not validate token. Please verify the token has been correctly entere

  • Resolved twilocreative

    (@twilocreative)


    Hi, fresh install of WP 5.9.2 and plugin V4.0.1. Logged into FA Pro account and entered API key to get this message: “Could not validate token. Please verify the token has been correctly entered.”

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Hey @twilocreative thanks for making this new support thread.

    It is an odd problem as I am sure you are just copying the key directly from Font Awesome and plunking it into this plugins settings, so it should be valid. This plugin takes the provided key, and uses it with the Font Awesome GraphQL API to get a token.

    The call out to the API to get the token happens here:

    /wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-6.php:105

    It would be interesting to know the value of $response on line #129. Which you could potentially log temporarily on a staging/test environment using code like this:

    file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log.txt', print_r($response, true));

    That would create a log.txt file at the document root of your test/staging environment with the contents of $response.

    Another way to learn more about this problem would be to ignore my plugin entirely, and run the test CURL command with your API Key detailed here:

    https://fontawesome.com/docs/apis/graphql/token-endpoint

    example:

    curl -H "Authorization: Bearer YOUR_API_KEY_GOES_HERE" \-X POST \https://api.fontawesome.com/token

    This could be run in terminal on mac, or from this online curl command tool: https://reqbin.com/curl

    If you are comfortable doing either/both of the above suggestions it might provide us some clues as to what is going on here. In both cases I am wondering if a valid token is being generated, or if you are getting an error.

    Let me know!

    • This reply was modified 4 months, 2 weeks ago by Matt Keys.
    Thread Starter twilocreative

    (@twilocreative)

    This is now resolved and no issue with the plugin. Thank you for the quick response.

    Plugin Author Matt Keys

    (@mattkeys)

    Good to hear. If you think that other people experiencing the same problem as you might be able to learn from your solution, please do share it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.