Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

A bit of Requests driven utility code to drive the Salesforce.com Oauth2 Web flow. Use this module to login to a Salesforce account using just the username and password. Good for tests and scripts which need Salesforce access_token access.

Installation

pip install salesforce-oauth-request-yplan

Usage

You need a Connected App defined in Salesforce so that you have all these pieces of info:

  1. client ID

  2. client secret

  3. redirect uri

Now you can get an access_token and instance_url like this:

import salesforce_oauth_request

result = salesforce_oauth_request.login(username=username,
                                        password=password,
                                        client_id=client_id,
                                        client_secret=client_secret,
                                        redirect_uri=redirect_uri)

print "Access token:  {}".format(result['access_token'])
print "Refresh token: {}".format(result['refresh_token'])
print "Instance URL:  {}".format(result['instance_url'])

# Now use access_token, instance_url for REST, SOAP, or BULK API access.

Options

cache_session=True/False - default False

Pass the option cache_session=true to save the access token to ~.sf_oauth to save time on repeated runs.

sandbox=True/False - default False

Pass sandbox=True to use a sandbox login. ## Testing

History

1.1.1 (2016-07-14)

  • Brought back HISTORY.rst.

  • Changed package repository url to the fork.

1.1.0 (2016-07-14)

  • Python2 and Python3 compatibility.

  • Forked salesforce-oauth-request-yplan package.

Metadata

Release files for salesforce-oauth-request-yplan 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for salesforce-oauth-request-yplan 1.1.1
File Size Uploaded
salesforce-oauth-request-yplan-1.1.1.tar.gz 7.2 kB Details

Release files / salesforce-oauth-request-yplan-1.1.1.tar.gz

Download URL salesforce-oauth-request-yplan-1.1.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f189aedddf61b6f07a6bcaecde5bd57b0ba020af070e2ea574b160fe18f870d5
BLAKE2b-256 checksum
How to use checksums
57a16da83cee1ab7fb14fb189fa3d1e4ebcb0578aeb96eafe496d136d6e81488
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page