Second-Party vs Third-Party
How Securely classifies your application — and how that classification changes how a business consents and which OAuth flow you use.
Securely Connect classifies every OAuth client as either second-party or third-party. The classification is set when your client is registered and is encoded in every access token as the party_type claim. It determines two things:
- How the business consents to your access.
- Which OAuth flow you use.
The difference is small in words but big in shape. Pick which one fits before you write any code.
SECOND_PARTY — keys belong to one business
A second-party integration is built for a specific business. That business is your customer (or your employer). They sign in to their Securely portal, generate a client_id + client_secret, and hand the credentials to you, the developer.
The handoff of those credentials is the consent. The business has already approved the integration by issuing the keys. Every access token you mint from those keys is automatically scoped to that one business — no consent screen is needed because the business itself did the consenting when they generated the keys.
- One set of keys per business. The keys carry the business identity. You can't use them to access a different business.
- Canonical flow:
client_credentials. Your backend exchanges the keys for a business-scoped access token. - No consent screen. The keys are the consent.
- Typical client type: CONFIDENTIAL (the key/secret lives in your backend).
- Typical use case: A single-tenant integration — e.g., a business has internal tooling that needs to read transactions and create payment links automatically.
Each new business → new keysIf a different business wants the same integration, they generate their own
client_id+client_secretin their portal. You'll then maintain one set of credentials per business — typically in a key vault, keyed by the business identifier.
THIRD_PARTY — one set of keys, many businesses
A third-party integration is the marketplace pattern. You're a developer building an application that many businesses will sign up for. You register one Securely client and maintain a single set of credentials. Each business that wants to use your app authorizes you separately, at runtime, through the consent flow — they log in, see your app's name and logo, and pick which of their businesses to grant you access to.
- One set of keys total. You don't manage per-business credentials. The user's consent issues a business-scoped access token at runtime.
- Canonical flow:
authorization_code+ PKCE + consent. - Consent screen required, every business. Your end user picks which business you may access. See business-consent-third-party.
client_credentialsis not allowed. Third-party clients must always act on behalf of a user who has consented.- Typical client type: PUBLIC (SPA, mobile, desktop) — but CONFIDENTIAL is also valid.
- Typical use case: A multi-tenant product — e.g., an accounting app, a marketplace integration, anything where you onboard many businesses.
Confidential third-party still uses PKCEEven if your third-party client has a
client_secret, you don't skip PKCE. Consent for a third-party app only happens at/oauth/authorize, and that endpoint requires acode_challenge. A confidential third-party client uses the same flow as a public one and additionally sendsclient_secreton the token exchange.
At-a-glance comparison
| SECOND_PARTY | THIRD_PARTY | |
|---|---|---|
| Who issues the keys | The business, in their Securely portal | You, by registering a single client with Securely |
| Number of credential sets you manage | One per business | One total |
| Consent | Implicit — the keys are consent | Explicit — consent screen, per business |
| Canonical grant | client_credentials | authorization_code + PKCE |
client_credentials allowed | ✓ | ✗ |
authorization_code allowed | ✓ (uncommon) | ✓ (required) |
| User present at runtime | No (server-to-server) | Yes (user picks a business) |
| Typical client type | CONFIDENTIAL | PUBLIC (or CONFIDENTIAL) |
How to know which you are
Ask yourself: "Are these keys tied to one specific business, or will my app be used by many businesses with one set of keys?"
- One business → second-party. Use the keys they generated for you.
- Many businesses → third-party. Register one client with Securely and onboard each business through consent.
If your keys were generated by a business inside their Securely portal, you're second-party. If your keys were generated by you against Securely directly, you're third-party.
What this means for your integration
- Second-party: Go to Client Credentials Flow. You'll exchange your
client_id+client_secretfor an access token and start calling the resource API. No consent screen, no user click. - Third-party: Go to The PKCE Authorization Code Flow, then Business Consent. Your user logs in, picks a business, and your app receives a business-scoped access token.
The Choosing Your OAuth Flow guide turns this into a two-question decision tree.
Updated 7 months ago
What’s Next
- Public vs Confidential Clients — the second dimension of your client classification.
