
The problem OAuth solves
In the past, add-on programmes often asked for an account’s password in order to access its data. That gave them full access: they could read and change everything and kept the password until it was changed. If you wanted to withdraw access from a single programme, you had to change the password for all the others as well.
OAuth separates these things. The password or the passkey is only used on the service’s own page. The add-on programme instead receives a token that has only certain rights, expires after a short time and can be revoked individually. OAuth therefore governs permission (authorisation), not the question of who someone is. For identity there are methods built on top of it, such as OpenID Connect, which is behind many “Sign in with …” buttons.
How an OAuth approval works
- Request
The programme that wants access redirects you to the service’s approval page and states the rights it wants.
- Sign in to the service
You sign in on the service’s genuine page, not in the third-party programme.
- Confirm the approval
The service shows which programme wants which rights. You agree or decline.
- One-time code
After you agree, the programme receives a short-lived code that it exchanges for a token. With PKCE, it proves in the process that it is the same programme that made the request.
- Access with the token
With the token, the programme calls the service’s API, but only within the approved scope.
- Renew or revoke
When the token expires, the programme uses a refresh token to get a new one. If you revoke the approval, neither works any more.
The key terms around OAuth
| Term | Meaning |
|---|---|
| Client | The programme that wants access, for example an AI assistant or a reporting tool |
| Resource owner | The person who owns the data and gives consent |
| Authorisation server | The part of the service that handles the approval and issues tokens |
| Scope | The extent of the rights, such as “read contacts” |
| Access token | Short-lived key for the API calls |
| Refresh token | Longer-lived key for getting a new access token, ideally replaced each time it is used |
| PKCE | Extra protection so that an intercepted one-time code is worthless to third parties |
OAuth 2.1 brings together the experience of more than ten years of OAuth 2.0. Insecure variants are dropped, PKCE is mandatory for all programmes, and refresh tokens should change every time they are used. In practice, this means that anyone building an OAuth connection today follows these stricter rules.
OAuth or API key?
Both routes give a programme access to an API, but they suit different situations. An API key belongs to a fixed connection that a business sets up itself, for example between its website and its CRM. OAuth fits when a person gives a third-party programme access on their behalf and is meant to manage that access themselves.
| API key | OAuth | |
|---|---|---|
| Who sets it up? | Administrator in the programme | The person themselves, by giving consent |
| On whose behalf? | On behalf of the business or a connection | On behalf of the person who consented |
| Validity | Until the expiry date or deletion | Short-lived tokens that are renewed |
| Typical use | Web form, in-house reporting | AI assistant, third-party app |
| Revoking | Delete the key | Remove the approval in the settings |
In practice, many businesses use both side by side. The same principle matters for both routes: as few rights as possible, an overview of all active connections and consistently removing access nobody needs any more.
OAuth and AI assistants
AI assistants have given OAuth a new job. Through the Model Context Protocol (MCP), assistants such as Claude or ChatGPT can access business software, for example to search for contacts or create a note. To keep this under control, the person approves access via OAuth. The assistant never gets the password, only a token with clear rights, and the approval can be withdrawn in the business software at any time. For an AI agent that carries out several steps on its own, this limitation is particularly important.
- Before agreeing, check which programme is asking for which rights.
- Only approve the rights needed for the task.
- Regularly revoke approvals that are no longer used.
- Always open the approval page via the service’s genuine address.
A practical example
Example: a consultant in St. Gallen connects her AI assistant
The fictitious consultant Anna Muster runs a small consultancy in St. Gallen and works with an AI assistant every day. She wants to be able to ask it which quotes (Offerten) are open this week without copying the data in by hand each time.
In the assistant, she adds the MCP address of her CRM. She is redirected to the CRM’s sign-in page, signs in with her passkey and sees which rights the assistant will receive. She confirms. From now on, the assistant answers her questions with up-to-date data. When she switches to a different assistant, she revokes the old approval in the CRM with one click.
Invented example for illustration.
How VoxCRM helps
yesVoxCRM uses OAuth to connect AI assistants such as Claude or ChatGPT via MCP. You sign in to VoxCRM itself and confirm what the assistant may do; your sign-in details never go to the assistant, and you can disconnect connected apps at any time. The address for the connection is https://app.voxcrm.ch/api/mcp. More under integrations and API.
