Salesforce API — JWT Authentication

Salesforce JWT Authentication with Python and Postman example

Techletters
Tech Force

--

Salesforce API — JWT Authentication

Using JWT to connect to the Salesforce API seems tricky and the official Salesforce documentation is not very beginner-friendly. Don’t worry — it's not that hard. I will show you all the details below. This story contains the following steps.

  • Basic introduction
  • How to create a certificate?
  • Creation of a Connected App in Salesforce
  • Construct the JWT
  • Working example with Postman
  • Working implementation with Python

Basic introduction

JWT — short for JSON Web Token — is an Internet Standard and often used for authentication. It’s basically a string that holds information in a JSON-based structure, divided into different segments: header, payload & signature.

The Header contains information about the cryptographic algorithm used to generate the signature.

The Payload is a set of claims that contain the details. The JWT specification defines seven standard claims that are commonly included in tokens. Additionally, custom claims can be used, depending on the purpose of the token.

--

--