{"id":18793208,"url":"https://github.com/alexandramartinez/data-cloud-auth","last_synced_at":"2026-01-25T22:30:52.921Z","repository":{"id":250046339,"uuid":"833304430","full_name":"alexandramartinez/data-cloud-auth","owner":"alexandramartinez","description":"This is a simple Mule 4 application where you can see the process to authenticate to Data Cloud using only HTTP Requests.","archived":false,"fork":false,"pushed_at":"2024-11-12T21:53:12.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T15:18:30.314Z","etag":null,"topics":["anypoint-code-builder","authentication","authorization","data-cloud","datacloud","integration","mule","mule4","mulesoft","salesforce"],"latest_commit_sha":null,"homepage":"https://youtu.be/iGlPOy_EMlE","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexandramartinez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-24T19:05:04.000Z","updated_at":"2024-11-12T21:53:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c8228b5-9031-4f4c-8b7e-e719ee490cb7","html_url":"https://github.com/alexandramartinez/data-cloud-auth","commit_stats":null,"previous_names":["alexandramartinez/data-cloud-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexandramartinez/data-cloud-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandramartinez%2Fdata-cloud-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandramartinez%2Fdata-cloud-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandramartinez%2Fdata-cloud-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandramartinez%2Fdata-cloud-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandramartinez","download_url":"https://codeload.github.com/alexandramartinez/data-cloud-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandramartinez%2Fdata-cloud-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28760646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anypoint-code-builder","authentication","authorization","data-cloud","datacloud","integration","mule","mule4","mulesoft","salesforce"],"created_at":"2024-11-07T21:23:59.567Z","updated_at":"2026-01-25T22:30:52.898Z","avatar_url":"https://github.com/alexandramartinez.png","language":null,"readme":"# Salesforce Data Cloud auth process in MuleSoft\n\nThis is a simple Mule 4 application where you can see the process to authenticate to Data Cloud using only HTTP Requests.\n\nFor more examples and instructions to integrate MuleSoft and Data Cloud using the connector, please see [this repo](https://github.com/alexandramartinez/datacloud-mulesoft-integration).\n\nVideo explanation: [How to manually authenticate to Salesforce Data Cloud through a MuleSoft integration](https://youtu.be/iGlPOy_EMlE)\n\n\u003e [!IMPORTANT]\n\u003e Only use this manual authorization if the operation you are trying to access is not currently available in [Salesforce Data Cloud Connector - Mule 4](https://www.mulesoft.com/exchange/com.mulesoft.connectors/mule4-sdc-connector/). Otherwise, please use the connector instead.\n\n## Similar repos\n\n[![](https://github-readme-stats.vercel.app/api/pin/?username=alexandramartinez\u0026repo=datacloud-mulesoft-integration\u0026theme=default_repocard)](https://github.com/alexandramartinez/datacloud-mulesoft-integration)\n[![](https://github-readme-stats.vercel.app/api/pin/?username=alexandramartinez\u0026repo=mule-dynamodb-to-datacloud\u0026theme=default_repocard)](https://github.com/alexandramartinez/mule-dynamodb-to-datacloud)\n\n## Auth process explained\n\nThese are all the steps the Mule application is taking care of. If you intend to use this code, you only need to update the properties in [default.yaml](src/main/resources/default.yaml).\n\nIf you need a different call that's not `/api/v1/ingest/jobs` for the Data Cloud API (and is not currently available from the Data Cloud connector), then you just need to update this path in the last HTTP Request.\n\n### Step 1: Retrieve the first token\n\nSend a POST request to `https://login.salesforce.com/services/oauth2/token` with an `application/x-www-form-urlencoded` body containing the following information:\n\n```json\n{\n  \"client_id\": \"your-connected-app-clientId/key\",\n  \"client_secret\": \"your-connected-app-clientSecret\",\n  \"username\": \"salesforce-username\",\n  \"password\": \"salesforce-password\",\n  \"grant_type\": \"password\"\n}\n```\n\n\u003e [!NOTE]\n\u003e In this example, I am using password authentication, but you can use others if needed. Learn more about this [here](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_username_password_flow.htm\u0026type=5).\n\nYou will receive a JSON response similar to this one:\n\n```json\n{\n  \"id\": \"https://login.salesforce.com/id/00Dx0000000BV7z/005x00000012Q9P\",\n  \"issued_at\": \"1278448832702\",\n  \"instance_url\": \"https://yourInstance.salesforce.com/\",\n  \"signature\": \"0CmxinZir53Yex7nE0TD+zMpvIWYGb/bdJh6XfOH6EQ=\",\n  \"access_token\": \"00Dx0000000BV7z!AR8AQAxo9UfVkh8AlV0Gomt9Czx9LjHnSSpwBMmbRcgKFmxOtvxjTrKW19ye6PE3Ds1eQz3z8jr3W7_VbWmEu4Q8TVGSTHxs\",\n  \"token_type\": \"Bearer\"\n}\n```\n\nYou will need to retrieve the `instance_url` and the `access_token` for the next call.\n\n### Step 2: Retrieve Data Cloud's details\n\nTake the `instance_url` you got from the previous call and concatenate the path `/services/a360/token` at the end. You should end up with something like:\n\n```\nhttps://yourInstance.salesforce.com/services/a360/token\n```\n\nNow make a POST request to that URL with an `application/x-www-form-urlencoded` body containing the following information:\n\n```json\n{\n  \"grant_type\": \"urn:salesforce:grant-type:external:cdp\",\n  \"subject_token\": \"the access_token you got from the previous call\",\n  \"subject_token_type\": \"urn:ietf:params:oauth:token-type:access_token\"\n}\n```\n\nYou will receive a JSON response similar to the previous one. Once again, you will need to retrieve the `instance_url` and the `access_token` for the next call.\n\n### Step 3: Call the Data Cloud API\n\nTake the `instance_url` from the previous call and concatenate the path you want to call from Data Cloud's API. In my case, it was `/api/v1/ingest/jobs`. You also have to add `https://` at the beginning of the URL. You will use this new URL to call the Data Cloud API.\n\nApart from that, you have to make sure to send the Bearer token in the Authorization header. For that, make sure you send the `Authorization` header in the request and the value should be:\n\n```\nBearer your-access_token\n```\n\nMake sure you leave a space between the word Bearer and the actual access_token from step 2.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandramartinez%2Fdata-cloud-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandramartinez%2Fdata-cloud-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandramartinez%2Fdata-cloud-auth/lists"}