Streaming API connections using OAuth
See original GitHub issueI’m unable to subscribe to topics using OAuth based connections unless I perform a query first.
The following code never gets a message:
var salesforceConnection = new jsforce.Connection({
instanceUrl: salesforceInstanceUrl,
oauth2: {
clientId: salesforceClientId,
clientSecret: salesforceClientSecret,
loginUrl: salesforceLoginUrl
},
refreshToken: salesforceRefreshToken
});
salesforceConnection.streaming.topic('Topic').subscribe(function(message) {
console.log(message);
});
The following is my workaround:
var salesforceConnection = new jsforce.Connection({
instanceUrl: salesforceInstanceUrl,
oauth2: {
clientId: salesforceClientId,
clientSecret: salesforceClientSecret,
loginUrl: salesforceLoginUrl
},
refreshToken: salesforceRefreshToken
});
salesforceConnection.describe('Custom__c', function() {
salesforceConnection.streaming.topic('Topic').subscribe(function(message) {
console.log(message);
});
});
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Set Up Authorization with OAuth 2.0 - Salesforce Developers
Setting up OAuth 2.0 requires some configuration in the user interface and in other locations. If any of the steps are unfamiliar, you...
Read more >OAuth 2.0 for Mobile & Desktop Apps - YouTube
OAuth 2.0 allows users to share specific data with an application while keeping their usernames, passwords, and other information private. For ...
Read more >How to Secure APIs Using OAuth in API Connect - YouTube
See the basic working setup of OAuth provider API in API Connect. Download sample APIs and Postman collection: https://ibm.co/2u2OQ1VIn this ...
Read more >Connecting to a streaming endpoint | Docs - Twitter Developer
Requests must use of HTTP Basic Authentication, constructed from a valid email address and password combination. Connecting. To connect to the Streaming API, ......
Read more >Authenticate an IMAP, POP or SMTP connection using OAuth
Register your application · Get an access token · Authenticate connection requests · Use client credentials grant flow to authenticate IMAP and POP ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@stomita I am facing the same issue . I am not able to get the events . Can we subscribe to topics and does jsforce refreshes its token automatically for streaming apis. @freshlogic is there any latest update on this ?
@stomita @freshlogic Does auto-refresh and auto-reconnect of dropped streaming client connections are supported?