-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting to salesforce #29
Comments
Hi @danwwilson, without more information from the error, I'm not sure I know exactly what's going on. If I'm reading correctly, you are using "abc123" as the value for your refresh token? I think this would be incorrect - what you want is the value that comes back during the Oauth flow. It should be in the response under the Another option is to add some more debugging to the code to see the exact error message that accompanies the 400. I would expect to see more text, but you could add a breakpoint or more logging output in this area: https://github.com/singer-io/tap-salesforce/blob/master/tap_salesforce/salesforce/__init__.py#L286-L298 |
I am having the same issue, but using the value taken from "Initial Access Token Value" in the connected app setup. |
Quick and dirty way to solve this
After authorising your application, you will be redirected to another url. There will be a
You will now have your refresh token for use in this tap. |
I'm trying to follow these instructions also but I'm not clear on what the prerequisites are for getting auth correctly configured.
I don't appear to have permissions to create an app under my organization (I'm not a salesforce admin) and I'm not clear if an app created at developer.salesforce.com will suffice. Any guidance would be much appreciated. |
I just went through this, this is a copy/paste of my docs: Salesforce development environments You can register for a fully featured Salesforce developer account with access to a developer instance. Once inside, go to Setup: In the left-hand tree, select PLATFORM TOOLS / Apps / App Manager New Connected App Fill: Connected App Name: With those settings you will be redirected to a web containing your Consumer Key and your Consumer Secret. Get a refresh token Open in your browser:
Click allow, get the “code” from the URL (without %3D)
|
@alexpdp7 - I was blocked by this before and went a different route - using instead the normal user/account-based authentication which is (as of last check) only supported in the Meltano fork of this tap. Can you confirm for me one thing - after following the above instructions, does this only give your new "app" access to the specific dev/test salesforce instance? Specifically, it appeared based upon my previous research that you might still need some level of "admin access" on the salesforce instance you want to tap into, which for many uses cases may not feasible. Any additional info you could provide on access-level permissions needed to be granted to the custom app within the "tapped" salesforce instance, and what process is needed to provide those permissions, would be very helpful. Thanks! |
I don't think I can help you there much, I'm just toying around with developer instances (registered via their developer website like anyone can do)- I expect in this case I'll only gain access to the test instance. You can do the same and then test on a real instance. I have the feeling that it might be possible to do adequate testing without spending money... |
Has anyone here gotten past this point and is now runing into I can't seem to figure out what I'm doing wrong here. |
I know this response is late, but may help others. @aaronsteers - You still need a user to authenticate with Salesforce. The connected app seems to be a way to be able to revoke access for a specific purpose. E.g., sign into a site using Twitter, then within Twitter you could remove that app's access to your data. Your "app" that logs in as your user will have the permissions you assign to the app within Salesforce. Yes, it is per org instance. When you create the connected app, the app will be assigned a client ID unique to your org. If using a test instance, I found the config needs to have @samrogers226 - I did not see that error message. I did, however, add my IP to the list of allowed IP Addresses before attempting the initial sync. Instead of doing this, you can relax your IP restrictions by clicking These are the two policies I have enabled:
Also note that the discovery phase didn't automatically select any objects for me. I had to dig into the singer-python codebase and best practices to figure out what to do and where. Inside the Here's a brief example schema from the discovery phase: {
"streams": [
"stream": "<object name>",
"tap_stream_id": "<object name>",
"schema": {
// omitted for brevity
},
// this is a weird schema, in my opinion. I'd have pulled the `selected` type info
// up into a property called "config" or "settings".
// instead, you have to look for the metadata object with empty breadcrumbs.
"metadata": {
{
"breadcrumb": [
"properties",
"Id"
],
"metadata": {
"inclusion": "available",
"selected-by-default": true
}
},
{
"breadcrumb": [],
"metadata": {
"valid-replication-keys": [
"SystemModstamp"
],
"table-key-properties": [
"Id"
],
// this is what was missing after my discovery phase.
"selected": true
}
} It is a pain to get an access token when there isn't much in the docs. I'm used to using the Machine-to-Machine connection from Auth0, so I was surprised that I ended up having to log in as an actual user and convert the access code to an access token, then get the refresh token. I haven't tested a lot, but it appears that refresh tokens are good for 24 hours. If your app isn't constantly running, or at least run once per <24 hours, you'll have to go through the process again. So +1 for that PR that's been sitting there for a year that will allow user name + password login, instead. Anyway, this article walks through how to get the refresh token you need. It uses curl, but Postman or something similar can also be used. https://medium.com/@bpmmendis94/obtain-access-refresh-tokens-from-salesforce-rest-api-a324fe4ccd9b |
Hey @samrogers226 , were you able to figure that out? I'm facing the exact same issue now... Thanks EDIT: I was able to connect and run in |
Also, for anyone who's struggling to authenticate, I've found the last answer in this thread gave me the solution.
This returns a 302 redirect response. Just put the redirect URL returned into your browser, and it will take you to a Salesforce login followed by an OAuth opt-in page. Click ok, and then your access token and your refresh token appears in the URI in the browser tab. |
I'm attempting to make use of this tap and am struggling to make things work at present. I've created a salesforce connected app following these instructions. I did make the callback URL
https://127.0.0.1
In the
config.json
file I have the following:When I run the code
tap-salesforce --config config.json --discover
I get the following messages:I'm really interested in making singer.io connect to salesforce, but can't seem to get passed connecting. Some guidance would be really appreciated.
Cheers
Dan
The text was updated successfully, but these errors were encountered: