When the ebay-api client automatically refreshes the OAuth2 token (via the autoRefreshToken: true configuration), the new token emitted in the refreshAuthToken callback appears to have restricted permissions. Specifically, it fails to fetch Business Policies, resulting in unauthorized/permission errors. However, creating a new token manually via the eBay Auth API using the same credentials and scopes works perfectly.
Initialize the eBay client with autoRefreshToken: true.
Wait for the initial token to expire (2 hours).
client.OAuth2.on('refreshAuthToken', async (newToken) => {
// Use this newToken to call Business Policy APIs (e.g., Account API)
});
Observe that API calls to Business Policies fail with this newToken.
Manually request a token using the same refresh token/scopes via a separate API call—this manual token works.
Expected behavior The newToken provided by the refreshAuthToken event should be functionally identical to a manually refreshed token and should maintain all scopes (including those required for Business Policies/Account API) granted during the initial user consent.
When the ebay-api client automatically refreshes the OAuth2 token (via the autoRefreshToken: true configuration), the new token emitted in the refreshAuthToken callback appears to have restricted permissions. Specifically, it fails to fetch Business Policies, resulting in unauthorized/permission errors. However, creating a new token manually via the eBay Auth API using the same credentials and scopes works perfectly.
To Reproduce
Initialize the eBay client with autoRefreshToken: true.
Wait for the initial token to expire (2 hours).
Catch the new token in the event listener:
Observe that API calls to Business Policies fail with this newToken.
Manually request a token using the same refresh token/scopes via a separate API call—this manual token works.
Expected behavior The newToken provided by the refreshAuthToken event should be functionally identical to a manually refreshed token and should maintain all scopes (including those required for Business Policies/Account API) granted during the initial user consent.
- API Scopes Used