API key is "forgotten" again and again

Created on 26 April 2022, about 2 years ago
Updated 5 July 2023, 12 months ago

Problem/Motivation

I currently have the problem that the API key is forgotten. It only helps to uninstall the module, reinstall it and generate a new API key via the UI. The problem occurs after different number of transmissions, sometimes it is 20, sometimes 10, in the last test after 1 node was saved.

the following error is logged in the error log:

Index Now returned an error: Client error: `GET https://www.bing.com/indexnow?url=https://domain.tld/node-name&key=xxx&keyLocation=https://domain.tld/index_now_api_key_xxx.txt` resulted in a `403 Forbidden` response: {"code":"UserForbiddedToAccessSite","message":"User is unauthorized to access the site. Please verify the site using the (truncated...)

how can i save the api key persistent? maybe in the settings.php? after generating i can't find the file on the server either, where is the text file stored?

as it seems to me, the problem occurs only recently, after i installed the last drupal version 9.3.12. until now it has actually always worked, just not anymore. therefore i would like to store the api key persistently in the repo. is this possible?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany zcht

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

    • MacSim β†’ authored dacde3c8 on 2.0.x
      Issue #3277139 by zcht, MacSim: API key is "forgotten" again and again
      
  • πŸ‡«πŸ‡·France MacSim

    Hi @zcht,

    You can now use the 2.0.x branch :

    • config_split has been added to dependencies
    • the API key doesn't rely on state anymore but is saved as a setting instead. An API key will be generated for you during the install or update process and you can override the value if needed in your settings(.local).php

      $settings['index_now']['api_key'] = 'whatever-you-want';
      
  • πŸ‡©πŸ‡ͺGermany zcht

    Hi @MacSim, thanks for the great update. I was able to test the new 2.x dev version for a few days and it looks really great.

    From my side gladly RTBC++ :)

  • Status changed to Fixed 12 months ago
  • πŸ‡«πŸ‡·France MacSim

    Hi @zcht,

    Glad to read that.
    I delivered a 2.0.0 release this morning.
    Since you considered it RTBC and now that you can override the API key in the settings, I am setting this issue status as "fixed".
    Feel free to open new issues if needed.

    Thank you once again for your patience and help on this one!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024