Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[Talend SF Connection JWT]runtime exception https status 400-bad request message {“error”:“invalid_grant”,“error_description”:“audience is invalid”}

Hi Community ,

 I am facing an error while trying to establish the Oauth connection (JWT) between talend ETL tool and salesforce :

runtime exception https status 400-bad request message {"error":"invalid_grant","error_description":"audience is invalid"}

Here are the steps I have performed : (Talend Documentation)

  1. Downloaded the self signed certificate from salesforce.
  2. Created the connected app
  3. Used following url to authenticate the user

    https://test.salesforce.com/services/oauth2/authorize? <client_id>=& redirect_uri=https://test.salesforce.com/services/oauth2/success& response_type=code

Settings on talend connection:

  1. Name : Name of the Connection
  2. Connection Type : oAuth
  3. Oauth2 flow type : Json web token Flow
  4. Issuer : client_Id from connected app
  5. Subject : Salesforce userName
  6. Expiration in time : 600
  7. Keystore : Certificate from salesforce
  8. Keystore Password : password for certificate
  9. Certificate alias : Name of the certificate.

Advanced setting : Salesforce Url :https://test.salesforce.com/services/oauth2

 

Thanks in advance

Labels (4)
6 Replies
Anonymous
Not applicable
Author

Hello,

Could you please take a look at this page to know more about 400 bad request error and check the error in the URL as suggested?

Feel free to let us know if it is OK with you.

Best regards

Sabrina

samT
Contributor III
Contributor III

Hello praveenbonalu,

 

I am facing similar problem when trying to do a test connection to the Salesforce sandbox. Please let me know how did you resolve this. Thanks Sam

samT
Contributor III
Contributor III

Hi Sabrina, Please can you help me on this one. Exact error I am getting and having seen the 400 bad request page not getting anything where could be the problem. I understand the problem is with URL. We are having URL in 2 places one mentioned in the Salesforce connected apps for the callback url. and another one in the advance option of the salesforce connection as originally mentioned in this post.

not sure which url is having problem as both can be access by the user id.thanks

Anonymous
Not applicable
Author

Hello @samT

Sorry for our silence. We do our best to answer as many posts as possible.

We have replied to your another topic:https://community.talend.com/t5/Design-and-Development/Talend-DI-7-0-to-Salesforce-connection-using-...

Could you please have a look at it?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hello guys,

 

We faced the same issue a few weeks ago and we found the reason of this as you can see here: https://github.com/Talend/components/issues/1423

 

This is a part of the component code which handles the JWT authentication. The audience URL seems to be hardcoded for a Production environment and there is no way to make it works with a Sandbox environment. So we used a basic auth for sandbox and a JWT auth for the production.

 

Regards

samT
Contributor III
Contributor III

Hello Harry, thanks for your reply.

Problem is without testing the Oauth in sandbox I cannot deploy the job in production. 

 

I can't find SalesforceJwtConnection.java in the Talend studio installed folder. Please let me know if you manage to find any workaround for Sandbox.

 

Thanks