OAuth 2.0 Token Exchange Fails with 401 in Multi-Tenant AppFoundry App

Encountering a 401 Unauthorized error when executing the /oauth2/token exchange endpoint for a multi-tenant Premium App deployment. The client credentials are valid and the scope includes appfoundry:write, yet the response payload consistently returns "error": "invalid_grant".

  • Verified the OAuth client ID and secret match the AppFoundry application configuration exactly.
  • Confirmed the redirect URI is registered and matches the request parameter character-for-character.