Some integrations hold one person’s account at another service: a builder signs in with that service, and the integration’s actions then act as that account. They all work the same way, whatever the provider. Each provider’s own setup page explains how to register Baserow with it, and links here for what they share.
Baserow signs in through an OAuth app registered with the provider: the authorization code flow with PKCE, as a confidential client, then refresh tokens. By default one app is registered for the whole installation and builders never see it. Until an admin registers it, accounts of that provider can’t be connected, and the integration form says so.
Every provider sends the person back to the same kind of page. Register this redirect URI with the provider’s app, for the provider’s integration type:
<PUBLIC_WEB_FRONTEND_URL>/integrations/<integration type>/oauth-callback
For example https://baserow.example.com/integrations/microsoft/oauth-callback. A
builder sees the exact value in the integration form while the app isn’t set up.
An app’s client secret usually expires. When it does, every account connected through it stops working until you set a new secret, so note the date and plan the rotation.
For developers. A provider is an integration type built on the shared base in
backend/src/baserow/contrib/integrations/oauth_account/ and
web-frontend/modules/integrations/oauthAccount/:
OAuthAccountIntegrationMixin and Integration, declaring its
own access_token and refresh_token as EncryptedTextFields with a context of
its own. Fields of its own that a sign-in sets go in extra_connection_fields.OAuthProvider subclass: its endpoints, how it tells who signed in
(identify), its base scopes and how its errors read. Its behaviour flags,
allow_account_switch, keep_connection_in_duplicates and
keep_connection_in_published_copies, are shared product decisions: change them
for every provider at once. To let an integration bring its own OAuth client, return
it from get_client.OAuthAccountIntegrationTypeMixin and sets
provider. The sign-in endpoints, under /api/integrations/oauth/<type>/, come
with it.OAuthAccountServiceTypeMixin, with required_scopes and
permission_description. request_as_account sends a request as the account and
turns the provider’s answers into dispatch errors; build paths from formulas with
quote_path_segments. Services serialize their required_scopes, so the
frontend never repeats them.OAuthAccountIntegrationType with its
providerName and image. Its form is OAuthAccountForm, or a form of its own
that wraps it and adds fields in its extras slot. To offer “Grant access” in an
action’s form, use the type’s getMissingScopes(integration, service).docs/installation/ that links to this one.