Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/ai-agents/platform/authenticate/build-auth/build-your-own.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ Requires a bearer token.

### Example

<Tabs>
<TabItem value="python" label="Python SDK" default>

```python title="agent.py"
from airbyte_hubspot import HubspotConnector, AirbyteAuthConfig
from airbyte_hubspot.models import HubspotOAuthCredentials

# Set your own OAuth app credentials
await HubspotConnector.configure_oauth_app_parameters(
airbyte_config=AirbyteAuthConfig(
airbyte_client_id="<your_airbyte_client_id>",
airbyte_client_secret="<your_airbyte_client_secret>",
),
credentials=HubspotOAuthCredentials(
client_id="<your_hubspot_oauth_client_id>",
client_secret="<your_hubspot_oauth_client_secret>",
),
)
```

</TabItem>
<TabItem value="api" label="API">

```bash title="Request"
curl -X PUT https://api.airbyte.ai/api/v1/oauth/credentials \
-H 'Authorization: Bearer <operator_token>' \
Expand All @@ -105,8 +128,39 @@ curl -X PUT https://api.airbyte.ai/api/v1/oauth/credentials \
}
```

</TabItem>
</Tabs>

The configuration schema varies by connector. To get the required fields for a specific connector, call `GET /api/v1/oauth/credentials/spec?connector_type=<connector_type>`.

### Removing an override

To revert to the default Airbyte-managed OAuth app, remove the override:

<Tabs>
<TabItem value="python" label="Python SDK" default>

```python title="agent.py"
await HubspotConnector.configure_oauth_app_parameters(
airbyte_config=AirbyteAuthConfig(
airbyte_client_id="<your_airbyte_client_id>",
airbyte_client_secret="<your_airbyte_client_secret>",
),
credentials=None,
)
```

</TabItem>
<TabItem value="api" label="API">

```bash title="Request"
curl -X DELETE "https://api.airbyte.ai/api/v1/oauth/credentials/connector_type/hubspot" \
-H "Authorization: Bearer <operator_token>"
```

</TabItem>
</Tabs>

## Part 2: Initiate the OAuth flow

When your user wants to connect a third-party service, initiate the OAuth flow to get a consent URL.
Expand Down
Loading