pub-sub-api-node-client icon indicating copy to clipboard operation
pub-sub-api-node-client copied to clipboard

{"error":"invalid_grant","error_description":"request not supported on this domain"}

Open shalikas opened this issue 1 year ago • 3 comments

    const client = new PubSubApiClient({
        authType: 'oauth-client-credentials',
        loginUrl: process.env.SALESFORCE_LOGIN_URL, // https://test.salesforce.com
        clientId: process.env.SALESFORCE_CLIENT_ID,
        clientSecret: process.env.SALESFORCE_CLIENT_SECRET
    }); 

getting: [cause]: Error: Authentication error: HTTP 400 - {"error":"invalid_grant","error_description":"request not supported on this domain"}.

Tried to enable everything in connected app, nothing works, same credentials are working with connecting via Nextjs.app, pleaase help me find out what can cause this and how to fix that. Thank you

shalikas avatar Feb 03 '25 14:02 shalikas

Hi @shalikas, this looks like either a connected app configuration issue or a client configuration issue. Since you've managed to log in with another app, I'll assume that it's the latter. Try to switch loginUrl to your Org's domain. This should do the trick.

pozil avatar Feb 04 '25 09:02 pozil

@shalikas did you solve your issue?

pozil avatar Feb 17 '25 07:02 pozil

@shalikas did you solve your issue?

sadly no, it works perfectly with authType: 'username-password', but with 'oauth-client-credentials' it is not working for me giving same results even with loginUrl passed as Org's domain, probably some configuration on connected app side is failing, if i find out, i will let you know. Thank you

shalikas avatar Feb 17 '25 09:02 shalikas