Invalid Key Error with Simple OAuth 5.2.3, lcobucci/jwt 4.3.0, and steverhoades/oauth2-openid-connect-server 2.5.0

Created on 6 February 2023, about 2 years ago

I am not sure if this is an issue related to Simple OAuth or not. Also, I am not sure if someone else is experiencing this issue or not.

Configuration:
* Drupal 9.5.3 (it also occurred with 9.5.2)
* Simple OAuth 5.2.3
* Lcobucci\JWT 4.3.0
* SteverHoades/oauth2-openid-connect-server 2.5.0

An issue arises after updating steverhoades/oauth2-openid-connect-server (v2.4.0 to v2.5.0), and therefore lcobucci/jwt (4.1.5 => 4.3.0). After updating, the following error occur in the Drupal log:

Lcobucci\JWT\Signer\InvalidKeyProvided: Key cannot be empty in Lcobucci\JWT\Signer\InvalidKeyProvided::cannotBeEmpty()

Nothing else has changed on my end, excluding these two packages. This is using a custom API endpoint defined within a custom module's routing.yml file.

This works with jwt 4.1.5. and oauth2-openid-connect-server 2.4.0. I know that oauth2-openid-connect-server 2.5.0 requires jwt 4.2 or newer. The key length is not the issue, as it exceeds the minimum needed.

I do not know if this is working properly on the latest versions with 6.x-dev. If it does then I will not worry about making it work with the 5.x line, and plan on upgrading to 6.0 when it is released. Also, if this is not an issue with simple_oauth at all, but should be directed elsewhere, I would appreciate knowing that as well.

🐛 Bug report
Status

Active

Version

5.2

Component

Code

Created by

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

Comments & Activities

  • Issue created by @wdixonrails
  • 🇦🇺Australia championlife

    I am also experiencing this issue, running a Next-Drupal headless site.

    * PHP 8.1
    * Drupal 9.5.3
    * Simple OAuth 5.2.3

  • 🇮🇳India Rash Robie

    In the Simple OAuth settings (/admin/config/people/simple_oauth), the "Generate Keys" option is used to generate cryptographic keys required for token signing and verification. These keys must be generated during the initial configuration of the module. Generating the keys resolved the issue for me.

Production build 0.71.5 2024