Using an API token for a different instance does not fail when creating media entities from the browser

Created on 8 May 2023, over 1 year ago

Problem/Motivation

If I configure my Bynder settings to point to a pilot/test instance of Bynder, and I use settings.php config overrides to provide the API token (which is for the production, not pilot instance), then when I create media entities, they get created with empty data instead of showing some kind of error.

Steps to reproduce

Proposed resolution

For an exception to be thrown instead of catching it somewhere.

Remaining tasks

User interface changes

New exception will be visible instead of silently failing

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA

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

Comments & Activities

  • Issue created by @dave reid
  • πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA
  • πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA
  • πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA

    Another interesting thing to note that the requirements check in hook_requirements() does not fail with this scenario. The call to getBrands() still works even without a valid API token.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    There are 3 different authentication things that make all of this quite confusing and settings overrides might not work as expected. Ther's the server-side authentication, thre's the per-user oauth login state stored in the session if you use the upload feature and then there's the compact view login state that's completely detached from Drupal.

    Try to log out completely to check if that's causing issues.

    In the past, it was possible to specify a different URL/portal in the compact view than what was used by Drupal, causing weird problems too, that should be enforced now.

  • πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA

    We are using the server-side API permanent token and the compact view only (no upload).

Production build 0.71.5 2024