Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API, a headless CMS and data platform. Specifically, the "Authentication" resource with the "Start OAuth Flow" operation initiates an OAuth authentication process for a specified provider. This is useful when you want to authenticate users via OAuth providers supported by Directus, such as Google, GitHub, or others configured in your Directus instance.

Typical use cases include:

  • Starting an OAuth login flow to obtain user authorization.
  • Redirecting users to the OAuth provider's login page.
  • Integrating third-party OAuth authentication into workflows.

For example, you might use this node to start the OAuth flow for a Google provider, which will return the URL or redirect the user to Google's login page to authorize access.

Properties

Name Meaning
Provider The key identifying the activated OAuth provider (e.g., "google", "github").
Additional Fields Optional extra parameters:
- Redirect URL to redirect to after successful login. If set, authentication details are stored in cookies; otherwise, a JSON response is returned.

Output

The output of this operation is a JSON object containing the data returned from the Directus API endpoint that starts the OAuth flow for the specified provider. Typically, this includes information such as the OAuth authorization URL or other relevant metadata needed to continue the OAuth process.

If the Redirect field is set, the node expects the authentication details to be handled via cookies on redirection rather than returning JSON.

No binary data output is involved in this operation.

Dependencies

  • Requires a valid API key credential for the Directus API to authenticate requests.
  • The Directus instance must have the OAuth provider configured and enabled.
  • Network access to the Directus API endpoint.

Troubleshooting

  • Invalid Provider Key: If the provider key does not match any configured OAuth provider in Directus, the API will likely return an error. Verify the provider key matches exactly the one configured in your Directus instance.
  • Missing Credentials: Ensure the node has proper API credentials configured to communicate with the Directus API.
  • Redirect URL Issues: If using the Redirect property, ensure the URL is correctly formatted and accessible. Misconfiguration may cause failed redirects or missing authentication details.
  • API Errors: Any errors returned by the Directus API during the OAuth flow initiation will be surfaced. Check the error message for details and verify your Directus server status and configuration.

Links and References

Discussion