Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
samT
Contributor III
Contributor III

Talend DI 7.0 to Salesforce connection using Oauth JWT audience is invalid error

Hello Experts,

I am able to create a SalesforceConnection using Basic method. But getting below error when I try to create a connection using type OAuth.

RuntimeException: HTTP status:400 - Bad Request message:

{"error":"invalid_grant","error_description":"audience is invalid"}

 

I followed the steps exactly mentioned here:

https://help.talend.com/reader/4cgA8~D~pdi5biHRfSvg_Q/ZoXS~zBdrcuQAx427Yv6Gw

Please help me to resolve this.

 

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 connected App.

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

 

Thank you

Labels (5)
8 Replies
Anonymous
Not applicable

Hello,

Did you create your own connected app required by JWT Flow in Salesforce?

We have recheck with the related documentation step by step and it works from our end.

0683p000009M0lC.png

Best regards

Sabrina

samT
Contributor III
Contributor III
Author

Thanks for checking this Sabrina.

Yes I created my own connected app same as mentioned in the steps. My problem is I am able to connect to production Salesforce without issue but having problem when trying to connect to a Sandbox environment.

 

Thanks

 

Anonymous
Not applicable

samT
Contributor III
Contributor III
Author

Thank you Harry

 

samT
Contributor III
Contributor III
Author

Hello Sabrina, please check if you can connect to a salesforce sandbox using OAuth.

Anonymous
Not applicable

Hello,


@samT wrote:

Hello Sabrina, please check if you can connect to a salesforce sandbox using OAuth.


I don't have a salesforce sandbox and will check it with our Dev and IT to see if it is possible to have a salesforce sandbox testing environment.

Best regards

Sabrina

Selina1
Contributor
Contributor

Sabrina,

 

Do you have update for this issue. I am migrating talend to 7.2.1. I got the same error while using JSON web Token Flow to do OAUTH against SF sandbox.

 

Thank you!

 

 

Anonymous
Not applicable

Hello,

Talend does not support sandbox audience in this V 7.1 version of the tSalesforceConnection component. So, you can't connect to a sandbox instance using the JWT Flow.

This is permanently fix in Talend 7.2.1

Or try to use the other two available authentication methods Basic or OAuth (Implicite) to connect to Sandbox.

Best regards

Sabrina