Skip to content

a minimalist tool for testing and debugging oauth2 SF connected app configurations. run it locally to validate oidc metadata, token requests, and callback flows.

License

Notifications You must be signed in to change notification settings

dchahla/salesforce-connected-app-oauth2-debugger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

salesforce-connected-app-oauth2-debugger

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 without needing to adhere to http timeouts --> 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.)
  • automated & offline 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

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. Get Authorization Code. 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

Require Client Secret Selection (Is this app Public / Private?)

https://help.salesforce.com/s/articleView?id=xcloud.configure_oauth_code_credentials_flow_external_client_apps.htm&type=5#:~:text=If%20you%E2%80%99re%20using,to%20the%20browser.

App Overview Bottom - Required Secret Location

Open to pull requests, or feature requests. If this helped throw me a star! If you are Salesforce, throw me a job!

Cheers!

About

a minimalist tool for testing and debugging oauth2 SF connected app configurations. run it locally to validate oidc metadata, token requests, and callback flows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published