Make OAuth token retrieval more robust

Created on 29 September 2025, 7 days ago

Problem/Motivation

Entity Share OAuth authentication fails intermittently after
deployments or when OAuth tokens expire. When the stored OAuth token
is missing or invalid, Entity Share client connections fail
permanently without attempting to recreate the token, requiring
manual intervention to restore functionality.

Steps to reproduce

  1. Set up Entity Share client with OAuth authentication using
    client credentials
  2. Delete/expire the stored OAuth token
  3. Attempt to use Entity Share client connection
  4. Connection fails with no automatic recovery mechanism

Proposed resolution

Add fallback mechanism to the OAuth plugin in
entity_share_client that automatically attempts to
recreate OAuth tokens using client credentials when no valid token
exists. This ensures robust Entity Share connections without manual
intervention.

The patch modifies Oauth.php in the
entity_share_client module to:

  • Check for missing tokens after existing token validation
    fails
  • Automatically request new tokens using
    client_credentials grant type
  • Store the new token for subsequent requests
  • Log failures appropriately for debugging

Remaining tasks

-

User interface changes

None - this is a backend improvement that makes OAuth
authentication more robust.

API changes

None - the existing OAuth plugin API remains unchanged.

Data model changes

None - uses existing key-value storage for OAuth tokens.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇭🇺Hungary aron novak Hungary, Budapest

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024