We've created an app for HubExchange which is now listed. When a user opens the app, we receive the encoded JWT payload through the application login endpoint as documented here. We decode this payload (using the JWT secret key) to get the oauthToken (along with some other parameters) and we use this auth token for subsequent in-app REST and SOAP requests. So far, so good.

The token expires after one hour and I'm not sure how to refresh it. Sure, there's a refreshToken included in the decoded JWT payload, but you need a clientId and clientSecret to request a new token using the refreshToken (indicated in the node-fuel module).

We tried using the clientId and clientSecret associated with the app from App Center, but unsurprisingly that does not work, we get {"message": "Unauthorized", "errorcode": "1", "documentation": ""} response.

Does anyone know how we can use a refreshToken after an hour, for the use case where a user has the HubExchange app open for longer than one hour?

  • Relevant: Marketing Cloud oAuth and RefreshToken Expires after First Use. We've had similar issues. Our API guys say SFMC isn't doing oAuth correctly. Feb 5, 2016 at 12:24
  • The clientID and clientSecret that are used with the RefreshToken would be the ones generated when you created the App in App Center. If you use that clientId and clientSecret without a refreshToken, do you get the same "Unauthorized" response?
    – Mac
    Feb 26, 2016 at 19:54

1 Answer 1


Try this: var fuel = require('fuel').configure({ authUrl: 'https://auth.exacttargetapis.com/v1/requestToken', clientId: 'xxxxxxxxxxxxxxxxxxxxxxxx', clientSecret: 'yyyyyyyyyyyyyyyyyyyyyyyy', refreshToken: 'zzzzzzzzzzzzzzzzzzzzzzzz', accessType: 'offline' });

refreshToken <- put refresh token from sso session

  • This isn't what I'm looking for. As per my question above, your solution requires a clientId and clientSecret, but if you have created a public HubExchange app, you don't have these credentials (as they will vary by the end user). Mar 17, 2016 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .