Skip to content

Commit

Permalink
Merge pull request #18 from kenrestivo-stem/feature/specify-hostname
Browse files Browse the repository at this point in the history
Accept login host explicitly. Addresses #17
  • Loading branch information
owainlewis authored Dec 14, 2018
2 parents 9dc9416 + 94efa91 commit 1e9b784
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ like this

(def auth-info (auth! config))
```
You can optionally pass in :login-host if you want to use test.salesforce.com or my.salesforce.com addresses

This returns a map of information about your account including an authorization token that will allow you to make requests to the REST API.

Expand Down
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(defproject salesforce "1.0.2-SNAPSHOT"
(defproject salesforce "1.0.2"
:description "A clojure library for accessing the salesforce api"
:url "http://owainlewis.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0-alpha16"]
:dependencies [[org.clojure/clojure "1.9.0"]
[clj-http "3.7.0"]
[cheshire "5.8.0"]])
9 changes: 4 additions & 5 deletions src/salesforce/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
- username USERNAME
- password PASSWORD
- security-token TOKEN
- sandbox? IS_SANDBOX
- sandbox-url URL"
[{:keys [client-id client-secret username password security-token sandbox? sandbox-url]}]
(let [login-host (if sandbox? (or sandbox-url "test.salesforce.com") "login.salesforce.com")
auth-url (format "https://%s/services/oauth2/token" login-host)
- login-host HOSTNAME (default login.salesforce.com"
[{:keys [client-id client-secret username password security-token login-host]}]
(let [hostname (or login-host "login.salesforce.com")
auth-url (format "https://%s/services/oauth2/token" hostname)
params {:grant_type "password"
:client_id client-id
:client_secret client-secret
Expand Down

0 comments on commit 1e9b784

Please sign in to comment.