OAuth 2.0 Token Refresh 401 in Multi-Tenant AppFoundry

I’ve spent hours trying to figure out why the token refresh endpoint returns a 401 Unauthorized error for specific tenant contexts in our multi-tenant deployment. The initial authorization works, but subsequent refresh attempts fail after exactly 30 minutes.

“Access tokens expire after 3600 seconds. Refresh tokens are valid for 30 days.”

This discrepancy is breaking our automated data sync jobs.