What role do Connected Apps play in establishing secure OAuth authentication frameworks with Salesforce?
Answer
Basics: Without registration, Salesforce cannot know which client is asking for access or what it may do. A Connected App provides the OAuth client ID and secret, lets admins approve or block the app, and ties tokens to policy. Note on direction: Salesforce is moving new integrations to External Client Apps and has restricted creation of new Connected Apps in newer releases; verify the current status in release notes. Existing Connected Apps continue to work.
How it works:
- Setup > App Manager > New Connected App (or an External Client App).
- Enable OAuth Settings, set the callback URL and select scopes (
api,refresh_token/offline access,openid,web,fulland more). - Salesforce generates the Consumer Key and Consumer Secret.
- Manage policies under Manage Connected Apps: Permitted Users (all users may self-authorize, or admin-approved users are pre-authorized through profiles and permission sets), IP Relaxation, Refresh Token Policy, session timeout, high assurance.
- The client runs an OAuth flow and receives an access token (and refresh token if allowed).
- Admins can revoke tokens and monitor usage via OAuth Usage.
Advanced / deep dive: Choose the flow to match the client: Web Server (with PKCE) for server apps, JWT Bearer for server-to-server with a certificate, Client Credentials for headless integrations tied to a run-as user, Device flow for devices. Use admin-approved pre-authorization plus permission sets to restrict who can use an integration. Scopes limit API surface (for example, api but not full). A dedicated integration user with minimal permissions is the standard pattern; scopes limit access further but never exceed the user's permissions. Connected Apps also support SAML SSO and can be packaged in managed packages (installed copies enforce subscriber policies).