DEV Community

Daniel Chahla
Daniel Chahla

Posted on

Salesforce: Connected App - ( OAuth2.0 Debugging Tool ! =)

Finally a community Salesforce guide, that works! A minimalist tool for testing and debugging OAuth2 configurations for Salesforce Connected Apps rapidly.

This tool provides an interactive web interface and backend service (running on port 3000) to help you quickly validate OIDC metadata, construct authorization requests with PKCE support 😲, and exchange authorization codes for tokens. The easily extendable, one-page frontend, styled with Tailwind CSS <-- 🏓 communicates bidirectionally 🏓 --> with the backend via WebSocket, making it easy to see responses in real-time while keeping data private.

Key features include:

  • fetching OIDC metadata from your connected app’s well-known endpoint
  • interactive forms to configure OAuth2 parameters (client ID, secret, callback URL, etc.)
  • automatic generation of PKCE code challenges and verifiers
  • constructing authorization URLs and handling callback redirects
  • debugging token requests with raw JSON responses

Run it locally to streamline your Salesforce OAuth2 connection settings and configuration.

TO RUN LOCALLY :

npm i
npx tsc
node dist/index.js
Enter fullscreen mode Exit fullscreen mode

EXAMPLE USAGE..

1) Enter your *.../.well-known/openid-configuration* URL to autopopulate available options. Then Click 'Send'.

Step 1

2. Enter the client_id (Consumer Key) and, if required, the client_secret (Consumer Secret) based on your app configuration, as seen in yellow.

Step 2

3) Click "Generate PKCE"

Generate a PKCE

4. Click "Construct Request" and follow the link "Authorize with Salesforce" to authenticate and return to the callback URL (this app listens for http://localhost:3000/callback, this must match your Connected App config. See bottom Set-up.)

authorize

5. Paste the code and click 'Exchange for Token'.

Authenticate

6. a. Get Result (access || id) token on success.

Get Token

6. b. Errors are returned as well.

err example

EXAMPLE SETUP

app creation -  Choose OAuth 2.0

App info

Edit App View - Edit Callback URLl

App Overview - OAuth Settings

Required Client Secret Location

App Overview Bottom - Required Secret Location

https://github.com/dchahla/salesforce-connected-app-oauth2-debugger
Open to pull requests, or feature requests. If this helped throw me a star! If you are Salesforce, throw me a job and some stock options!

Cheers!

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs