Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Error with legacy /v1/requestToken endpoint #20

Open
kabzit13 opened this issue Feb 22, 2019 · 2 comments
Open

Error with legacy /v1/requestToken endpoint #20

kabzit13 opened this issue Feb 22, 2019 · 2 comments

Comments

@kabzit13
Copy link

I have beam provided with new set of ClientId ClientSecret and when using them, I am getting error:
Error: No access token�[0m
Stack:
error properties: Object({ res: Object({ message: 'This integration is not eligible to use the legacy /v1/requestToken endpoint because the integration uses enhanced OAuth 2.0 functionality. To obtain a token for this integration, use the applicable Marketing Cloud OAuth 2.0 endpoint for authentication. For a web or public app, use /v2/authorize and then /v2/token. For a server-to-server integration, use /v2/token.', errorcode: 10007, documentation: '' }) })
Error: No access token
at FuelSoap. (/Users/ivanchol/Documents/projects/dmc-builder-data-extensions/node_modules/fuel-soap/lib/fuel-soap.js:99:21)
at _requestToken.then.body (/Users/ivanchol/Documents/projects/dmc-builder-data-extensions/node_modules/fuel-auth/lib/fuel-auth.js:91:19)
at process._tickCallback (internal/process/next_tick.js:68:7)

But same code with old credentials working as expected.
Thanks.

@selbyk
Copy link

selbyk commented May 20, 2019

Latest release should support the auth flow forced on new credentials. I believe you need to set in the options that you are using the new auth flow

@sfdrogojan
Copy link
Contributor

sfdrogojan commented May 21, 2019

Hi @kabzit13! The error you're getting means you are using the credentials of a package with enhanced functionality, which requires OAuth2 authentication. To use this feature, you should instantiate the client like in the example below:

const client = new ET_Client(clientId, clientSecret, stack, {origin, authOrigin, soapOrigin, authOptions = { authVersion = 2, accountId = <<TARGET_BUSINESS_UNIT>>, scope = <<DATA_ACCESS_PERMISSIONS>>}}); 

authOptions is required for OAuth2 authentication.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants