Skip to main content
PipesHub provides a built-in OAuth 2.0 authorization server that lets members of your organization register third-party applications and control how they access organizational data. This guide walks through the complete process of creating, configuring, and managing OAuth applications.

Who Can Manage OAuth Applications

Any member of the organization can create and manage OAuth applications. Some things need an organization admin: creating an application that uses the Client Credentials grant (it must act as a service account), and registering the admin-only scopes listed under Select Scopes.
To access the OAuth application management page:
  1. Sign in to your PipesHub account
  2. Open Workspace settings
  3. Select OAuth 2.0 apps under Developer settings
OAuth 2.0 apps page with eight registered applications and the New OAuth application buttonOAuth 2.0 apps page with eight registered applications and the New OAuth application button
This page lists the OAuth applications you registered. Only you see your applications here.

Creating a New OAuth Application

Follow these steps to register a new OAuth application.

Step 1: Open the Application Registration Form

From the OAuth 2.0 apps page, click the New OAuth application button.

Step 2: Provide Application Details

Fill in the following fields:
Create OAuth 2.0 application panel with app name, description, grant types, redirect URI and policy URLs filled inCreate OAuth 2.0 application panel with app name, description, grant types, redirect URI and policy URLs filled in
Providing a clear description and relevant URLs builds trust with users who are asked to grant access to their data during the consent flow.

Step 3: Configure Grant Types

Select the authorization grant types that your application requires:
The Client Credentials grant is designed for server-to-server communication where no user interaction is involved. The application authenticates directly using its client ID and client secret.An application that allows this grant must be bound to a service account when it is created. Its tokens act as that service account, so they see only what the service account can access. Only an organization admin can create such an application, and the service account must be enabled in the same organization.When to use:
  • Background services or automation scripts
  • Machine-to-machine integrations
  • Scheduled tasks that access organizational data
The Refresh Token grant allows your application to obtain a new access token without requiring the user to re-authenticate. This is enabled automatically when the offline_access scope is requested during the authorization code flow.Key details:
  • Refresh tokens are rotated on each use — the old token is revoked and a new one is issued
  • Your application should always store the latest refresh token
  • Refresh tokens have a default lifetime of 30 days (configurable per application)

Step 4: Add Redirect URIs

Redirect URIs define where PipesHub sends users after they authorize (or deny) access. You may register up to 10 redirect URIs per application.
Create OAuth 2.0 application panel with two redirect URIs and the Add redirect URI linkCreate OAuth 2.0 application panel with two redirect URIs and the Add redirect URI link
Requirements:
  • All redirect URIs must use HTTPS, except for localhost and 127.0.0.1 (permitted for local development)
  • The URI provided during the authorization request must exactly match one of the registered URIs
  • Redirect URIs are required when the Authorization Code grant type is enabled

Step 5: Select Scopes

Scopes define the specific permissions your application is requesting. Select only the scopes your application genuinely needs — following the principle of least privilege.
Permissions & scopes tab with scopes grouped by category and seven selectedPermissions & scopes tab with scopes grouped by category and seven selected
Scopes are organized by category for ease of selection. The following table provides a complete reference:
The API still calls actions toolsets, so these scopes are named toolset:*.
Only organization admins can register these scopes on an application: org:write, org:admin, user:invite, user:delete, usergroup:write, team:write, config:write, crawl:write and crawl:delete.

Step 6: Save and Store Credentials

After submitting the form, PipesHub generates a unique Client ID and Client Secret for your application.
OAuth application created panel with the client ID and the masked client secretOAuth application created panel with the client ID and the masked client secret
The Client Secret is displayed only once at the time of creation. Copy and store it in a secure location immediately. If lost, you will need to regenerate the secret, which invalidates the previous one.

Authorization Flow

The following diagram illustrates how the OAuth 2.0 Authorization Code flow operates within PipesHub.

Step-by-Step Breakdown

1

Initiate Authorization

Your application redirects the user’s browser to PipesHub’s authorization endpoint with the required parameters:
For public clients (PKCE), include additional parameters:
2

User Authentication

If the user is not already signed in to PipesHub, they are redirected to the sign-in page. After successful authentication, they are directed to the consent screen.
3

User Consent

The consent screen displays your application’s name, description, and the specific permissions being requested. The user can choose to Allow or Deny access.
OAuth consent screen listing the requested scopes with Deny and AllowOAuth consent screen listing the requested scopes with Deny and Allow
4

Authorization Code

Upon approval, PipesHub redirects the user’s browser back to your registered redirect URI with a temporary authorization code:
5

Exchange Code for Tokens

Your application exchanges the authorization code for tokens by making a server-side request:
For PKCE, include the code_verifier instead of client_secret:
Successful response:
The response has a refresh_token only when the granted scopes include offline_access. Add it to scope in the authorization request if your app needs to refresh tokens.
6

Access Protected Resources

Use the access token to make API requests on behalf of the user. For example, with the openid scope you can read the user’s profile:
Any other API route works the same way, as long as the token carries the scope that route needs.

Client Credentials Flow

For server-to-server integrations with no interactive user. The application must have been created with a service account, and the token acts as that service account:

Refreshing Tokens

When an access token expires, use the refresh token to obtain a new one without requiring user interaction:
PipesHub uses refresh token rotation. Each time you refresh, the previous refresh token is revoked and a new one is issued. Always store and use the most recent refresh token from the response.

Revoking Tokens

To revoke an access token or refresh token when it is no longer needed:
Set token_type_hint to either access_token or refresh_token to help the server identify the token type more efficiently.

Device Authorization Flow

Use the device flow (RFC 8628) for a CLI, a coding agent or any tool that cannot open a browser redirect. The tool shows a short code, the user approves it in a browser, and the tool polls for the token. The device grant is on by default. An administrator turns it off by setting PIPESHUB_ENABLE_DEVICE_GRANT=false on the backend. Which client_id to use. Every instance has a built-in public client for this flow. Its client_id is pipeshub-agent, and discovery returns it as pipeshub_device_client_id. It allows only the device and refresh token grants and needs no client secret. It does not appear in Developer settings. Applications you create in Developer settings cannot select the device grant.
1

Request a device code

If you leave out scope, the request gets every scope the client allows.
2

Ask the user to approve

Show the user user_code and verification_uri, or open verification_uri_complete. The user signs in to PipesHub, checks the code and the requested permissions, and approves or denies. The code expires after expires_in seconds (10 minutes).
3

Poll for the token

Poll the token endpoint every interval seconds:
Until the user decides, the endpoint returns HTTP 400 with one of these error values:After approval, the response is a normal token response. The token acts as the user who approved it. Each device code can be exchanged once.
The pipeshub CLI runs this flow for you with pipeshub login.

Dynamic Client Registration

PipesHub supports dynamic client registration (RFC 7591) at POST /api/v1/oauth2/register. It lets a client such as an MCP client create its own OAuth application without an administrator. Registration is off by default, because anyone who can reach the instance could register an application. While it is off, the endpoint returns 403 with "error": "access_denied". An administrator turns it on by setting PIPESHUB_ENABLE_DCR=true on the backend.
The response returns HTTP 201 with the new client_id and the registered metadata. It includes a client_secret only when token_endpoint_auth_method is client_secret_basic or client_secret_post. Rules for registered clients:
  • grant_types defaults to authorization_code and refresh_token. client_credentials is refused. Add urn:ietf:params:oauth:grant-type:device_code if the client will use the device flow.
  • redirect_uris is required with authorization_code, up to 10 URIs.
  • token_endpoint_auth_method defaults to none (a public client).
  • Each requested scope must be one a regular member may hold and, when MCP_SCOPES is set, one listed there. Otherwise the request fails with invalid_client_metadata.
  • The application belongs to the instance’s organization. The consent screen tells users that the application registered itself.

Discovery Endpoints

These endpoints are public and need no authentication. They are served at the root of the instance, not under /api/v1. The discovery document lists the authorization, token, userinfo, revocation and introspection endpoints, scopes_supported, and grant_types_supported. Some fields appear only when the feature is on: The protected resource document for /mcp lists only the scopes the MCP tools use. See MCP Server Overview.

Managing OAuth Applications

Viewing Application Details

Click on any application from the list to view its configuration, including the client ID, allowed scopes, grant types, redirect URIs, and token settings.
Manage OAuth 2.0 application panel with the General, Permissions & scopes, Granular permissions and Advanced tabsManage OAuth 2.0 application panel with the General, Permissions & scopes, Granular permissions and Advanced tabs

Regenerating the Client Secret

If your client secret has been compromised or needs to be rotated:
  1. Open the application detail page
  2. Click Generate new client secret
  3. Copy and securely store the new secret immediately
Regenerating the client secret immediately invalidates the previous secret. Any active integrations using the old secret will stop functioning until updated.

Suspending an Application

If you need to temporarily disable an application without deleting it:
  1. Select Manage on the application to open its panel
  2. Open the Advanced tab
  3. Click Suspend application
A suspended application cannot authorize new users or issue tokens. Existing tokens remain valid until they expire. To restore access, click Activate on the same tab.

Deleting an Application

Deleting an OAuth application:
  1. Revokes all active access tokens and refresh tokens associated with the application
  2. Permanently marks the application as revoked
Steps to delete an application:
  1. Select Manage on the application to open its panel
  2. Open the Advanced tab
  3. Click Delete application
  4. Confirm by putting the application name in dialog box
Application deletion is irreversible. All active integrations will lose access immediately.

Revoking Active Tokens

From the application panel, you can:
  • Revoke all tokens at once, which is useful in the event of a security incident
Steps to revoke all tokens:
  1. Select Manage on the application to open its panel
  2. Open the Advanced tab
  3. Under Revoke all tokens, click Revoke tokens
  4. Confirm by putting the application name in dialog box

Security Best Practices

Store Secrets Securely

Never expose client secrets in frontend code, public repositories, or client-side applications. Use environment variables or a dedicated secrets manager.

Use PKCE for Public Clients

Public clients (mobile apps, SPAs) must use PKCE with the S256 challenge method to protect against authorization code interception attacks.

Request Minimal Scopes

Only request the scopes your application genuinely needs. Users are more likely to trust and approve applications with narrowly defined permissions.

Validate the State Parameter

Always generate a unique, unpredictable state value for each authorization request and verify it in the callback to prevent cross-site request forgery (CSRF) attacks.

Handle Token Rotation

Always store the latest refresh token after each refresh operation. Using an outdated refresh token will fail and may trigger a security alert.

Revoke Tokens on Sign-Out

When users sign out of your application or disconnect the integration, revoke both access and refresh tokens to maintain a clean security posture.

API Endpoints Reference

The following table provides a quick reference for all OAuth 2.0 endpoints:

Troubleshooting

Common causes:
  • The redirect_uri does not exactly match one of the registered URIs for the application
  • The client_id is incorrect or belongs to a suspended/deleted application
  • The requested scopes include scopes that are not in the application’s allowed scopes
Resolution: Verify the client ID, redirect URI, and scopes in your application settings.
Common causes:
  • The authorization code has expired (codes are valid for 10 minutes)
  • The authorization code has already been used
  • The redirect_uri in the token request does not match the one used during authorization
  • For PKCE: the code_verifier does not match the original code_challenge
Resolution: Initiate a new authorization request and ensure the code is exchanged promptly.
Common causes:
  • The refresh token has been rotated and the old token was used instead of the most recent one
  • The refresh token has expired
  • The application or its tokens have been revoked by an administrator
Resolution: Redirect the user through the authorization flow again to obtain new tokens.
Common causes:
  • The access token does not include the required scope for the requested endpoint
  • The user does not have sufficient permissions within the organization
Resolution: Check the scope requirements for the endpoint and ensure your application requests the appropriate scopes.

FAQ

Yes. Any member can create an OAuth application. Only an organization admin can create one that uses the Client Credentials grant or register the admin-only scopes.
The previous secret is immediately invalidated. Any integration using the old secret will receive authentication errors. You must update all services that use the old secret with the new one.
There is no fixed limit on the number of OAuth applications per organization. However, each application can have a maximum of 10 registered redirect URIs.
Yes. PKCE (Proof Key for Code Exchange) is fully supported and is required for public (non-confidential) clients. Only the S256 challenge method is accepted.