Upon reauthorization, the return to blackbaud/oauth now yields an exception

Created on 12 March 2024, 4 months ago

Problem/Motivation

There appear to have been some recent changes to Blackbaud SKY API.

The major one I am noticing is that now, for the first, time, when I go to admin/config/services/blackbaud/authorize, as I normally do, whenever I need to reauthorize my connection, after successfully logging in to Blackbaud, I get an error message from Blackbaud (see attached screenshot), and the following exception in my logs:

Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned null. Did you forget to add a return statement somewhere in your controller? in () (line 98 of /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).

I tried to troubleshoot this myself by looking in blackbaud_sky_api routes file for the controller that corresponds to the blackbaud/oauth path that throws this exception, but none of the paths defined in blackbaud_sky_api.routing.yml is blackbaud/oauth. I then figured out that the default controller was responding to a route path defined in key_value/state.

Sure enough, that controller, does this:

$bb->getAuthCode('init', $_GET['code']);

and does not return anything at all. It seems that controller would need to be modified to provide a Response object.

In addition to this major issue, I also note that the configuration form (/admin/config/services/blackbaud) has links to

- View the OAuth base url just in case. https://apidocs.sky.blackbaud.com/docs/authorization/
- View the API base url just in case. https://apidocs.sky.blackbaud.com/docs/basics/

Both these links now go to 404 pages at Blackbaud.

Steps to reproduce

1. Try to reauthorize with Blackbaud. Recieve error message at Blackbaud and exception thrown at blackbaud/oauth route.

Proposed resolution

It seems we should add a Response object to the default controller, based on the exception. I am not sure what flavor Response object would be best to return.

Remaining tasks

Create a merge request at git.drupalcode.org with a potential fix. Discuss. Fix.

User interface changes

Perhaps take the time to update the links in the configuration form.

API changes

None that I am aware of.

Data model changes

none.

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apotek

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

Comments & Activities

Production build 0.69.0 2024