Skip to content

Instantly share code, notes, and snippets.

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair

@sardeie
sardeie / TransferSession.page
Created June 6, 2020 22:27 — forked from dsharrison/TransferSession.page
Transfer custom cookies in a community between Lightning and Visualforce with Locker Service enabled.
<apex:page showHeader="false" sidebar="false">
<!--
Replace <your_resource> with the name of the static resource with
your application files in it. This assumes that you are using a zipped static
resource with your javascript files in a 'js/' folder.
-->
<apex:includeScript value="{!URLFOR($Resource.<your_resource>, '/js/transfer-session.js')}" />
</apex:page>
public class SalesPreChat {
public Lead theLead {get; set;}
public Lead leadInsert {get; set;}
public String endpoint {get; set;}
public String jsSubmitForm {get; set;}
public SalesPreChat() {
jsSubmitForm = '';
theLead = new Lead();
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.