🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

salesforce-oauth-request-yplan

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

salesforce-oauth-request-yplan

Util package to drive Salesforce Oauth Web flow for testing.

1.1.1
PyPI
Maintainers
2

Salesforce Oauth Request

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

.. code-block:: python

pip install salesforce-oauth-request-yplan

Usage

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

  • client ID
  • client secret
  • redirect uri

Now you can get an access_token and instance_url like this:

.. code-block:: python

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

.. code-block:: python

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.

.. code-block:: python

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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts