Skip to content

A small package to use JWT client authentication against SalesForce with python.

License

Notifications You must be signed in to change notification settings

Rehket/sfdc-auth

Repository files navigation

SalesForce JWT Auth

Coverage Status Maintainability

A git installable python module to use server client auth against SalesForce

Installation

python -m pip install git+https://gitlab.com/Rehket/salesforce-jwt.git

Usage

import sfjwt
import requests


# With environment variables set:
instance_url, bearer_token = sfjwt.get_login()

# or if you just want to pass them:
#instance_url, bearer_token = SFJWT.jwt_login(
#    consumer_id="my_connected_app_consumer_id",
#    username="[email protected]",
#    private_key="my_connected_app_private_key",
#    environment="(sandbox|production)",
#)

# Make a request.
my_headers = {"Accept": "application/json", "Authorization": f"Bearer {bearer_token}"}
my_instance_data = requests.post(f"https://{instance_url}//services/data/v46.0/", headers = my_headers)

About

A small package to use JWT client authentication against SalesForce with python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published