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

Six Stars

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

Moderator

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

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.

oauth_jwt_works_well.png

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

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

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

 

Two Stars

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

Six Stars

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

Thank you Harry

 

Six Stars

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

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

Moderator

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

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

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.