One Star

Salesforce OAuth2 Authentication Failing

OS: Mac OS X (10.10.5)
Talend: 6.0.0
I am having trouble creating a usable Salesforce Connection. For some reason, the callback host/port is not being listened.
The component is not returning any errors, and does provide a url for authorization. And it does attempt to listen from that port, as evidenced by this log message.
2015-09-03 18:49:17.686:INFO:oejs.Server:jetty-8.1.12.v20130726
2015-09-03 18:49:17.807:INFO:oejus.SslContextFactory:Enabled Protocols of
2015-09-03 18:49:17.838:INFO:oejs.AbstractConnector:Started SslSelectChannelConnector@0.0.0.0:1234

My component settings are as follows:
Salesforce WebService URL: ""
Salesforce Version: 25.0
CallBack Host: localhost
CallBack Port: 8443
Token file: /Applications/Talend Data Integration/workspace/token.properties

I have considered using "Basic" type authentication, but as there is a security token that keeps changing, using it is out of the question.
6 REPLIES
Employee

Re: Salesforce OAuth2 Authentication Failing

I don't know much about this. But the port on the Jetty server is 1234 and the callback port is 8443. That seems like it might be the problem. I'm not sure if you can set the port on the Jetty server with some property.
One Star

Re: Salesforce OAuth2 Authentication Failing

I have tried 8443 as well. Didn't seem to work.
Moderator

Re: Salesforce OAuth2 Authentication Failing

Hi nathan_zch,
Can you connect Saleforce successfully by using the basic authentication mode? Is there something running on 8443 por?
Have you tried to use "login.salesforce.com/services/oauth2/token" and "443" for callback url and callback port to see if it works?
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.
One Star

Re: Salesforce OAuth2 Authentication Failing

Yes, I can connect to Salesforce via basic after I append the security token to the password. Nothing is running on port 8443 according to the Network Utility.
I only have the credentials for a salesforce sandbox, so my callback host has test instead of login. Trying to use 443 as port and test.salesforce... as callback host returns the following error:

2015-09-08 23:55:11.993:INFO:oejs.Server:jetty-8.1.12.v20130726
2015-09-08 23:55:12.105:INFO:oejus.SslContextFactory:Enabled Protocols of
2015-09-08 23:55:12.127:WARN:oejuc.AbstractLifeCycle:FAILED SslSelectChannelConnector@0.0.0.0:443: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:631)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:293)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.talend.salesforce.oauth.HttpsService.<init>(HttpsService.java:56)
at org.talend.salesforce.oauth.OAuthClient.getToken(OAuthClient.java:241)
at org.talend.salesforce.SforceOAuthConnection.loginWithOAuth(SforceOAuthConnection.java:107)
at org.talend.salesforce.SforceOAuthConnection.renewSession(SforceOAuthConnection.java:139)
at org.talend.salesforce.SforceOAuthConnection.init(SforceOAuthConnection.java:134)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:78)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:30)
at org.talend.salesforce.SforceOAuthConnection$Builder.build(SforceOAuthConnection.java:212)
at salesforce_alpha_au.coursesync_0_1.CourseSync.tSalesforceConnection_1Process(CourseSync.java:350)
at salesforce_alpha_au.coursesync_0_1.CourseSync.runJobInTOS(CourseSync.java:4033)
at salesforce_alpha_au.coursesync_0_1.CourseSync.main(CourseSync.java:3890)
2015-09-08 23:55:12.128:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@14d6cc5e: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:631)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:293)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.talend.salesforce.oauth.HttpsService.<init>(HttpsService.java:56)
at org.talend.salesforce.oauth.OAuthClient.getToken(OAuthClient.java:241)
at org.talend.salesforce.SforceOAuthConnection.loginWithOAuth(SforceOAuthConnection.java:107)
at org.talend.salesforce.SforceOAuthConnection.renewSession(SforceOAuthConnection.java:139)
at org.talend.salesforce.SforceOAuthConnection.init(SforceOAuthConnection.java:134)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:78)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:30)
at org.talend.salesforce.SforceOAuthConnection$Builder.build(SforceOAuthConnection.java:212)
at salesforce_alpha_au.coursesync_0_1.CourseSync.tSalesforceConnection_1Process(CourseSync.java:350)
at salesforce_alpha_au.coursesync_0_1.CourseSync.runJobInTOS(CourseSync.java:4033)
at salesforce_alpha_au.coursesync_0_1.CourseSync.main(CourseSync.java:3890)
Exception in component tSalesforceConnection_1
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:631)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:293)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.talend.salesforce.oauth.HttpsService.<init>(HttpsService.java:56)
at org.talend.salesforce.oauth.OAuthClient.getToken(OAuthClient.java:241)
at org.talend.salesforce.SforceOAuthConnection.loginWithOAuth(SforceOAuthConnection.java:107)
at org.talend.salesforce.SforceOAuthConnection.renewSession(SforceOAuthConnection.java:139)
at org.talend.salesforce.SforceOAuthConnection.init(SforceOAuthConnection.java:134)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:78)
at org.talend.salesforce.SforceOAuthConnection.<init>(SforceOAuthConnection.java:30)
at org.talend.salesforce.SforceOAuthConnection$Builder.build(SforceOAuthConnection.java:212)
at salesforce_alpha_au.coursesync_0_1.CourseSync.tSalesforceConnection_1Process(CourseSync.java:350)
at salesforce_alpha_au.coursesync_0_1.CourseSync.runJobInTOS(CourseSync.java:4033)
at salesforce_alpha_au.coursesync_0_1.CourseSync.main(CourseSync.java:3890)
One Star

Re: Salesforce OAuth2 Authentication Failing

I am have talend running on a amazon remote server and want to connect to salesforce using the oauth2 mode. What should be the callback url and port? I am able to connect via the basic authentication mode.   
Moderator

Re: Salesforce OAuth2 Authentication Failing

Hi asaxena1991,
Have you already checked component reference about:TalendHelpCenter:tSalesforceInput?
There are some descriptions about login type for OAuth2 mode.
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.