Add OAuth support

Created on 22 February 2023, almost 2 years ago

Problem/Motivation

Mailchimp module recently began supporting OAuth for authentication. API key usage has been deprecated and will be removed from the Mailchimp module in the near future. There are a few places in this module that need to be updated to take this into consideration.

Proposed resolution

Wherever there is a call to check for the api_key there needs to be new logic added to not only check for the key but also check for an active authentication. A new helper method was added to the Mailchimp PHP library that could be useful for this:

$object = \Drupal::service('mailchimp.client_factory')->getByClassNameOrNull($classname);
if ($object && $object->hasApiAccess()) {
  // Properly authenticated by either api_key or access_token.
}
πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States aprice42

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

Comments & Activities

Production build 0.71.5 2024