Get Salesforce OAuth2 Authorization URL
sf_get_oauth_auth_urlGenerates the Salesforce OAuth2 authorization URL for a Connected App to obtain an authorization code, which is then exchanged for a refresh token.
Instructions
Generates the Salesforce OAuth2 authorization URL for a Connected App. Open the returned URL in a browser to approve access. After approving, Salesforce redirects to the redirect_uri with a 'code' query parameter — pass that code to sf_exchange_oauth_code to obtain your refresh token.
Set sandbox=true to use test.salesforce.com instead of login.salesforce.com.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sf_client_id | Yes | Salesforce Connected App Consumer Key (Client ID) | |
| redirect_uri | No | Redirect URI registered in your Connected App | https://login.salesforce.com/services/oauth2/success |
| sandbox | No | Use sandbox login server (test.salesforce.com) instead of login.salesforce.com |