Extensions connect to outside services such as Linear, CRMs, ERPs, or email gateways through providers, connections, requirements, and bindings.
Extension code and AI agents hold sealed handles, never the secrets or refresh tokens themselves. Forge places a secret in a request only where its provider declares it, on a request to the provider’s hosts, so the service receives the secret and the code calling it doesn’t. See What sealing protects for where that guarantee ends. The pieces are:
- Provider: Declared in extension code with
defineProvider. Specifies the external service’s name, the allowed destinationhosts, the authentication methods (secretsoroauth2), where credentials belong on outgoing HTTP requests, and an optionalhealthcheck. - Requirement: Declared in
defineExtension({ org, user }, ...). Names a slot that needs a connection to a specific provider, scoped either to theorg, shared by all callers, schedules, triggers, and workflows in the repo, or to eachuser. A user requirement holds the calling person’s own connection, so schedule runs and workflow steps, which have no calling person, reach only org connections. - Connection: A saved credential in the org, created through a browser connection-request link so secrets never pass through chat or the CLI.
- Binding: Links a saved connection to one requirement of an extension in a specific repo.
Provider declarations
Use defineProvider from @buildr/sdk to declare an external service:
import {
basic,
bearer,
defineProvider,
header,
oauth2,
object,
plain,
query,
secrets,
string,
t,
} from "@buildr/sdk";
const linear = defineProvider({
name: "Linear",
hosts: ["api.linear.app"],
auth: {
oauth: oauth2({
label: "Sign in with Linear",
authorizationUrl: "https://linear.app/oauth/authorize",
tokenUrl: "https://api.linear.app/oauth/token",
scopes: ["read"],
request: ({ access_token }) => bearer(access_token),
}),
apiKey: secrets({
label: "Personal API key",
fields: object({
token: string().describe("Linear personal API key"),
workspaceSlug: plain(string()).optional(),
}),
request: ({ token }) => bearer(token),
}),
},
health: async ({ connection }) => {
const response = await fetch("https://api.linear.app/graphql", {
method: "POST",
headers: {
...connection.headers(),
"content-type": "application/json",
},
body: JSON.stringify({ query: "{ viewer { id name email } }" }),
});
if (!response.ok) {
throw new Error(`Linear rejected this credential (HTTP ${response.status}).`);
}
const body = await response.json();
const viewer = body?.data?.viewer;
return {
accountInfo: {
externalId: `${viewer.id}`,
email: viewer.email,
displayName: typeof viewer.name === "string" && viewer.name.trim() !== "" ? viewer.name.trim() : undefined,
},
};
},
});Allowed hosts and provider identity
hosts lists the hostnames to which the provider’s credentials may be sent. Each entry must be a lowercase hostname ("api.linear.app"), a host and port ("api.example.com:8443") with a port from 1 to 65535, or a single-level wildcard over a domain of at least two labels ("*.example.com", never "*.com"). A request to localhost or a private address is refused even when a provider declares it.
Forge derives a content-addressed provider_id (prv_…) by hashing the whole canonical provider definition except health: its name, its hosts, and its auth methods, labels included. Two extensions that declare identical provider definitions share the same provider_id. Changing any of these, even renaming the provider, produces a distinct provider_id whose connections must be authorized separately.
Authentication with secrets
secrets({ label, fields, request }) defines a form that a user fills in on the connection-request page:
fieldsmust be anobject({ ... })whose properties are form-compatible scalar types:string(),number(),integer(),boolean(), orliteral(...).- By default, every property in
fieldsis secret: extension code receives a sealed opaque handle inconnection.fields.<name>, never the real text, andrequestmust declare where that secret is placed on outgoing HTTP requests. - Wrap a non-secret property (such as a region or workspace slug) in
plain(string()). Extension code reads the real value of aplain()property inconnection.fields.<name>. - Wrap a secret that extension code must read directly in memory (for example, an HMAC signing key) in
raw(string()). Araw()property cannot be used inrequestplacements.
Sign-ins with a username and password (signIn)
Some sites have no API key or OAuth, only a sign-in form. A secrets method can declare signIn instead of placing its username and password, and Forge signs in to the site for ctx.browser, as a password manager would:
import { defineProvider, object, plain, secrets, string } from "@buildr/sdk";
const portal = defineProvider({
name: "Portal",
hosts: ["portal.example.com"],
auth: {
login: secrets({
label: "Email and password",
fields: object({ email: plain(string()), password: string() }),
signIn: ({ email, password }) => ({
url: "https://portal.example.com/login",
check: "https://portal.example.com/api/me",
username: email,
password,
}),
}),
},
});urlis the sign-in page. Forge opens it, finds the sign-in form’s fields by theirautocompleteattributes (usernameoremail, andcurrent-password), types the username and password into them, and submits the form. A site that asks for the username and the password on separate pages, or shows the password field only after the username, gets each in turn, for up to three pages. Forge waits up to 10 seconds for each field to appear, so a form that the page’s script draws after the page loads works too.checkis a page that answers200itself only to someone signed in, such as an account API or account page. Forge loads it after submitting, and a sign-in fails whencheckanswers anything else or sends the browser elsewhere, such as back to the sign-in page.- Connecting signs in first: a person who completes a connection request with a username and password the site doesn’t accept sees the site’s refusal on the form, and nothing is saved. When the site later stops accepting them, the connection stops signing in and reads as unhealthy until someone connects again; see the browser.
usernameandpasswordname two of the method’s fields. The password must be secret: marking itplain()orraw()is refused, as is a username markedraw(). The username may beplain().- Both pages must be
https://URLs on the provider’shosts. A provider whose sign-in page is elsewhere is refused as the extension loads. - The fields that
signInfills count as placed, so the method needs norequestfor them.fetchnever sends them: extension code holds the password only as a sealed handle, which no placement accepts. fetchcan send the session that a sign-in left, without a browser. See Signed-in sessions onfetch.- Signed-in sites walks through a whole extension that signs in, from declaring the provider to reading the site.
Forge never fills a form that has an autocomplete="new-password" field, such as a sign-up or change-password form, though a sign-up form beside the sign-in form doesn’t stop it. One exception: some sites mark their sign-in password new-password so that browsers offer no saved password, so on the sign-in page itself, before Forge has submitted anything, a form whose only password field is a new-password one counts as the sign-in form. A form that asks for the password twice, or a page after a submit that asks for a new one, as when a password has expired, is still refused. It never fills a form on a page that the site sent off the provider’s hosts, and never lets the sign-in post anywhere off them. List every host of the site that signed-in pages load, as the browser explains. It doesn’t solve CAPTCHAs or other bot challenges, so a site that shows one can’t be signed in to this way.
Signed-in sessions on fetch
A connection whose method declares signIn also sends its session with fetch, so a tool reads the site’s own JSON API without starting a browser:
const response = await fetch("https://portal.example.com/api/orders", {
headers: ctx.user.connections.portal.headers(),
});connection.headers()puts the session in itscookieheader as one sealed handle, after any cookie placements:session=<handle>; <session handle>. The outbound guard sends the handle as the session’s cookies that a browser would send to the request’s URL: a cookie set for one host goes only to that host, a cookie set for a domain goes to it and its subdomains, and only cookies whose path covers the URL’s path and that haven’t expired go. ASecurecookie goes only over HTTPS.- The session goes only to the provider’s
hosts, over HTTPS, and only in thecookieheader, standing on its own as a cookie does. Anywhere else, in the URL, another header, a cookie’s value, or the body, or to another host, the request is refused with421 NetworkRefused. - When the site answers
401to a request that carried the session, Forge signs in again in a browser, as an action ofctx.browserdoes, saves the new session, and sends the request once more. A request whose body Forge can’t send again, such as a stream, isn’t retried. When the sign-in fails, the site’s401is the answer, and the connection reads as unhealthy. - The session doesn’t change with the site’s answers: the outbound guard drops
set-cookieheaders from the answer to a request that carried it. - A connection with no saved session, or one whose password the site refused, has no session handle, so
headers()holds no session and the site answers as it does to anyone signed out. - A session cookie’s value of eight or more characters that the site echoes comes back as the session handle, as other secrets do.
Authentication with oauth2
oauth2(options) declares an OAuth 2 flow managed by Forge:
- Endpoints: Provide either
discover: "https://issuer.example.com"(to resolve endpoints from RFC 8414 or OpenID Connect discovery metadata) or explicitauthorizationUrl,tokenUrl, and optionalrevocationUrl. - Grant type:
grantdefaults to"authorization_code"(interactive user sign-in) and also supports"client_credentials". Aclient_credentialsmethod declaresdiscover, ortokenUrlwith an optionalrevocationUrl.authorizationUrl,authorizationParams, andpkce: falseare refused on it as the extension loads. - Scopes and parameters:
scopeslists requested OAuth scopes, andauthorizationParamsadds provider-specific query parameters to the authorize redirect, such as{ access_type: "offline", prompt: "consent" }. It can’t name a parameter that Forge sets itself:client_id,code_challenge,code_challenge_method,redirect_uri,response_type,scope, orstate. - Token endpoint auth and PKCE:
tokenEndpointAuthMethodcan be"client_secret_basic"or"client_secret_post". When you leave it out, the authorization server’s metadata decides, and Forge uses HTTP Basic when the metadata says nothing.pkcedefaults totrue. Setpkce: falsefor authorization servers that reject PKCE code verifiers. - Token placement:
request: ({ access_token }) => ...declares where the access token is placed on outgoing requests. Forge stores the refresh token in the org, where extension code never sees it. It renews an expired access token before a tool runs, and when a service refuses a request that carried the token, it renews the token and sends the request once more. A service refuses a token by answering401, or403with a Bearer challenge inWWW-Authenticatewhoseerrorisinvalid_token, as RFC 6750 allows. Any other403, such as one for a missing scope, is the answer as it stands, and so is the service’s refusal when the token can’t be renewed. - OAuth client: Signing in needs a client registered at the authorization server. Forge registers one itself when the server allows dynamic client registration. See OAuth clients.
Credential placements (request)
Both secrets and oauth2 take a request callback that receives opaque field references and returns one placement or an array of placements:
bearer(token): PlacesAuthorization: Bearer <token>.basic(user, password): PlacesAuthorization: Basic <base64(user:password)>.header("X-Api-Key", token): Places a custom header (header names are normalized to lowercase).query("api_key", token): Places a URL query parameter.cookie("session", token): Places one cookie in theCookieheader. Cookie names are case-sensitive and must be valid RFC 6265 names. Usecookie(...)rather thanheader("Cookie", ...), which is refused. When actx.browseraction opens a page with the connection, the cookie is set in the page’s browser context instead, for the provider’s hosts only. A cookie belongs to a host, not to a port, and Signed-in pages says what that means for a host’s other ports.tandbase64: Build composite header, query, or cookie values with the tagged templatetandbase64(...), as in the following placement:
request: ({ token, secret }) => header("X-Auth", t`Token ${token}:${base64(secret)}`)Always use the t tag rather than plain string interpolation, because field references throw if coerced to a plain string. t refuses two values with no text between them, such as t`${user}${token}`, because the outbound guard finds where each value ends by the text after it.
A provider’s declaration is checked as the extension loads, and a provider that breaks one of these rules is refused:
- A provider whose methods place credentials must declare
hosts. - Each placement must reference at least one secret field, one that isn’t
plain()orraw(). - A placement may reference at most one
plain()orraw()field. Araw()field can’t be placed at all.
Health checks (health)
When a provider declares health: async ({ connection }) => ..., Forge runs that function in the sandbox when a user submits credentials on a connection request that names your extension_name. It runs the health of the extension’s latest release, and only when that release declares the provider. Before the first release, or for a provider that only a branch declares, no health runs. A method with signIn still signs in to the site before saving, and any other connection is saved unchecked:
- For a
secretsmethod,healthruns before saving the connection. Ifhealththrows anError, the connection is refused withConnectionUnhealthyand the user sees your error message on the form. - For an
oauth2method,healthruns immediately after the OAuth callback saves the connection. If it throws, the connection is markedunhealthywith your message. - Returning
{ accountInfo: { externalId, displayName, username, email } }(all optional strings) records who the credential signs in as on the saved connection.
Requirements and outbound fetch calls
Pass your required providers in the first argument of defineExtension. A requirement’s name is an identifier of at most 128 letters, digits, and _ that doesn’t start with a digit, and is unique across the org and user scopes:
import { defineExtension, tool } from "@buildr/sdk";
export default defineExtension(
{
org: {
connections: { linear },
},
user: {
connections: { personalLinear: linear },
},
},
{
tools: {
listProjects: tool(
{ description: "Fetches projects from Linear", input: object({}) },
async (ctx) => {
const conn = ctx.org.connections.linear;
const response = await fetch(conn.url("https://api.linear.app/graphql"), {
method: "POST",
headers: {
...conn.headers(),
"content-type": "application/json",
},
body: JSON.stringify({ query: "{ projects { nodes { id name } } }" }),
});
if (!response.ok) {
throw new Error(`Linear returned ${response.status}`);
}
return response.json();
},
),
},
},
);Each bound connection on ctx.org.connections.<name> or ctx.user.connections.<name> exposes:
connection.id: The connection’s ID (connection_…).connection.method: The key of the auth method used to create the connection (for example,"oauth"or"apiKey").connection.fields: Object containing the real values ofplain()andraw()fields and sealed handles for secret fields.connection.headers(): Returns aRecord<string, string>containing all header placements declared by the connection’s auth method, ready to spread intofetch(..., { headers: { ...connection.headers() } }). Its cookie placements are joined into onecookieheader (session=<handle>; csrf=<handle>), followed by the handle of its signed-in session when its method signs in. To send other cookies as well, join them to that value with;rather than replacing it.connection.url(input): Takes a URL string orURLand returns a URL string with all query placements declared by the connection’s auth method applied.
How the outbound guard enforces security
When extension code calls fetch, the request passes through Forge’s outbound guard before it leaves the sandbox:
- Private addresses: A request to
localhostor a literal private, loopback, or link-local address is refused, whatever the provider declares. - Host allowlist: A call may only request URLs whose host matches the
hostsof one of the call’s bound requirements. A request to another host is refused before it leaves Forge. - Handle substitution and placement verification: The outbound guard inspects the URL, query parameters, headers, and body for sealed credential handles. It substitutes the real secret value only when the handle appears in the exact header, query parameter, or cookie declared by its provider’s
requestplacement, and only on a request to that provider’s allowedhosts. A signed-in session’s handle becomes the session’s cookies only where it stands on its own in theCookieheader. Other cookies in theCookieheader are sent as written. A request is refused when it carries a handle anywhere else, such as in the body, the URL path, an undeclared header or cookie, or a cookie’s name. - Echo redaction: If the upstream server echoes a substituted credential value back in its response headers, or in a JSON, form, or
text/*body of up to 1 MiB, the outbound guard replaces the secret with its sealed handle before returning the response to the sandbox. Redaction is best effort: it keeps a credential that a service echoes by accident out of tool results, logs, and agent transcripts. A secret in any other body, or one the service transforms, such as by encoding it in base64, reaches extension code as the service sent it. - Redirects: The outbound guard doesn’t follow redirects. The response returns to the sandbox, whose
fetchsends the next hop back through the guard, so each hop is checked again.
A refused request never reaches the service. fetch resolves with status 421, an x-forge-refused header, and a JSON body { "_tag": "NetworkRefused", "host": "...", "refusal": { "reason": "...", ... }, "message": "..." }. refusal.reason is one of the following:
reason |
Cause |
|---|---|
private_address |
The request names a private address, such as localhost, 127.0.0.1, 10.0.0.1, or 169.254.169.254, even one a provider declares. A name that DNS resolves to one is left to the platform, which refuses it. |
host_not_connected |
No connection that the call holds declares the request’s host. allowedHosts lists the hosts they declare. |
credential_host |
The request carries a handle to a host that its requirement doesn’t allow. |
credential_placement |
The request carries a handle somewhere its method doesn’t place it. location names where. |
credential_transport |
The request sends a credential over plain HTTP. Credentials go only over HTTPS. |
credential_method |
The request carries a handle and uses TRACE, which asks the service to echo the request back. |
credential_expired |
The handle is more than one hour old. Every call seals its handles afresh. |
credential_call |
The handle came from another call, or was altered. Use the connection that this call’s context holds. |
credential_query |
ctx.browser was asked to open a page with a method that places a credential in the query. Only the browser refuses this. |
When the guard allows a request but the network fails to send it, fetch resolves with status 502 and the body { "_tag": "NetworkUnreachable" }, so code can tell a failure from a refusal.
ctx.browser opens pages with a connection’s credentials under the same rules, and refuses a connection whose method places a credential in the query. See Signed-in pages.
Remote MCP servers
An extension calls a remote MCP server through the official MCP client, @modelcontextprotocol/client, which @buildr/sdk/mcp connects with a connection’s credentials. Declare the client in the extension’s package.json beside the SDK, such as "@modelcontextprotocol/client": "^2.4.0"; @buildr/sdk lists it as an optional peer, and a build that can’t resolve it fails with ExtensionBuildFailed. A provider declares the server’s host and places the credential, as for any service:
import { bearer, defineProvider, object, secrets, string, tool } from "@buildr/sdk";
import { connectMcp, mcpHealth } from "@buildr/sdk/mcp";
const url = "https://mcp.linear.app/mcp";
const linear = defineProvider({
name: "Linear",
hosts: ["mcp.linear.app"],
auth: {
key: secrets({ label: "API key", fields: object({ key: string() }), request: ({ key }) => bearer(key) }),
},
health: ({ connection }) => mcpHealth({ url, connection }),
});
const myIssues = tool({ description: "Lists my Linear issues", input: object({}) }, async (ctx) => {
const client = await connectMcp({ url, connection: ctx.user.connections.linear });
try {
const result = await client.callTool({ name: "list_issues", arguments: { assignee: "me" } });
const first = result.content[0];
const text = first?.type === "text" ? first.text : "";
if (result.isError) throw new Error(text);
return JSON.parse(text);
} finally {
await client.close();
}
});connectMcp({ url, connection })resolves to the official client’sClient, connected over Streamable HTTP with the connection’s credentials where its method places them. It always takes a connection, because the outbound guard refuses requests to hosts that no bound connection declares. Close the client when the tool is done with it.mcpHealthreads the server’s tools with the connection’s credentials and again without them. It passes only when the server accepts the first and refuses the second, because a server that answers anyone would accept a wrong key too. No tool runs.- The build installs the client version that the extension’s lockfile pins, like any package. Only an extension that imports
@buildr/sdk/mcpcarries the client in its bundle.
A server that signs people in with OAuth, as most remote MCP servers do, takes an oauth2 method that discovers its authorization server. Such servers usually allow dynamic client registration, so the first sign-in registers Forge there and no one enters a client:
const example = defineProvider({
name: "Example",
hosts: ["mcp.example.com"],
auth: {
oauth: oauth2({
label: "Sign in with Example",
discover: "https://mcp.example.com",
scopes: ["read", "write"],
request: ({ access_token }) => bearer(access_token),
}),
},
});What sealing protects
Sealing keeps a connection’s secret inside Forge. The people and code that can use a connection, such as extension authors, repo members who call a tool, and agents, can’t copy the secret out to use it elsewhere: outside Forge, against another host, or after they lose access to the repo.
Sealing can’t keep a secret from the service it’s sent to. A provider’s hosts receive the secret on every request, and a service that reflects request credentials back, in an error message, a debug endpoint, or a body that echo redaction doesn’t read, can show them to extension code. Connect a service only when you trust its hosts with the secret, and bind a connection only to extensions you trust to call that service.
Connection requests and repo bindings
Once an extension that declares a provider is released to the org’s registry and installed in the repo, connect and bind it in three steps:
# 1. Inspect the release's requirements and provider ID
forge registry get-extension-version --org "$ORG" --name integrations.linear --version 1.0.0
# 2. Create a connection request and give the returned browser link to the user
forge connections create-connection-request --org "$ORG" --data '{
"provider_id": "prv_...",
"audience": "org",
"extension_name": "integrations.linear"
}'
# 3. After the user completes the link, bind the saved connection to the repo's requirement
forge connections list-connections --org "$ORG"
forge connections upsert-connection-binding --repo "$OPS_REPO" --extension integrations.linear --requirement linear \
--data '{"connection_id":"connection_..."}'Completing a request takes the person who created it, signed in to the dashboard. Its page is where they submit the credentials or sign in at the provider, and the link opens for no one else. The CLI and MCP offer neither step, so an agent creates the request, gives its link to the person it acts for, and binds the connection once they complete it. An OAuth sign-in that starts on the page must finish within 10 minutes.
Creating and completing a request takes createConnections on the org, listing connections readConnections, deleting one deleteConnections, and binding or unbinding bindConnections on the installation. After an OAuth sign-in, health runs only for a member who also has readConnections. The default Editor and Viewer policies allow none of these, so a member needs a policy that does. Binding without --branch also takes read on the installation, which both policies allow. See the Action reference.
Bindings and audiences
A request names its connection’s audience, which has no default: org shares the connection with the whole org, and user keeps it to the person who connected it. Binding checks the connection against the requirement:
| Refusal | Cause |
|---|---|
RequirementMismatch |
The connection is to a different provider than the requirement names. |
ConnectionNotShared |
An org requirement takes only a connection whose audience is org. |
ConnectionNotUser |
A user requirement takes only a connection whose audience is user. |
ConnectionNotFound |
The connection doesn’t exist, or it’s another person’s user connection. |
ConnectionRequirementNotFound |
The extension’s version declares no requirement of that name. In the repo that defines the extension, pass --branch for one that only a branch declares. |
The org’s bindings fill org requirements for every caller. Each person binds a user requirement for themselves, with their own connection.
An extension that declares peers shares their bindings. When a requirement of the extension has no binding in the repo, it takes the connection that a peer’s binding names for the same provider and scope, so an extension that calls the service its peer calls needs no binding of its own. Declare the same provider as the peer, with the same name, sign-in methods, and hosts, so both have one provider ID. The extension’s own binding always wins. When two peers are bound to different connections, the extension takes neither until you bind it. Binding a peer’s requirement therefore also picks the connection its dependents call with.
Before releasing
You don’t have to release an extension to try its connections. Every commit publishes the extension, which registers its providers with the org, so a provider that only a branch declares is one the org can connect. A tool called on a branch of the repo that defines the extension, main included, holds the connections that the version the branch’s head publishes requires:
# 1. List what the branch's version requires, with each provider and its ID
forge extensions list-extension-requirements --repo "$OPS_REPO" --branch draft --name linear
# 2. Request a connection to the provider
forge connections create-connection-request --org "$ORG" --data '{
"provider_id": "prv_...",
"audience": "org",
"extension_name": "integrations.linear"
}'
# 3. Bind against the branch's requirements
forge connections upsert-connection-binding --repo "$OPS_REPO" --branch draft --extension integrations.linear --requirement linear \
--data '{"connection_id":"connection_..."}'Without --branch, a repo that defines the extension binds against the version main publishes. Every branch of the repo shares one binding per requirement name, so a binding made on one branch fills another whose version declares a requirement of the same name and provider. A provider’s ID covers its hosts, so code that sends a requirement to other hosts declares another provider, which needs a connection of its own.
If a tool is called before all of its requirements are bound on the target repo, the API refuses the call with ConnectionRequired and names the missing requirement. If an OAuth server refuses to refresh an expired token before a tool runs, the call fails with OAuthReconnectRequired so that a user can authorize another connection and rebind the requirement. When it refuses while a tool runs, after a service refused the token, the tool’s request gets the service’s own refusal, and later calls fail with OAuthReconnectRequired. When Forge can’t renew an expired token before a tool runs for another reason, as when the server doesn’t answer or the org’s OAuth client was deleted, the call fails with OAuthRenewalFailed (503), and trying again later can succeed. When that happens while a tool runs, the tool’s request gets the service’s own refusal.
Connection management
A connection request lasts 30 minutes. To shorten it, set expires_in_seconds to a value from 1 to 1800 when you create it. The connections CLI commands manage the rest:
| Command | What it does |
|---|---|
forge connections list-providers |
Lists the providers the org can connect, with their sign-in methods. |
forge connections get-connection-request |
Reads a request that you created: its status and the provider’s sign-in methods. |
forge connections delete-connection |
Deletes a connection that you connected, or an org connection when you’re an org owner. A bound connection is refused with ConnectionBound, which names a repo, extension, and requirement that hold it, until it’s unbound there. |
forge connections list-connection-bindings |
Lists which connection fills each requirement in a repo: the org’s bindings and your own. |
forge connections delete-connection-binding |
Empties a requirement: the org’s binding, or your own for a user requirement. |
OAuth clients
An oauth2 method signs in with an OAuth client registered at the authorization server. When Forge manages no client for that server and the org has none, the first sign-in registers Forge as the org’s client if the server’s metadata names a registration_endpoint (RFC 7591 dynamic client registration). The client is saved as if the person signing in had entered it, for Forge’s redirect URI, the site’s /api/oauth/callback. At a server that doesn’t allow registration, or one declared by its endpoints, the person completing the request registers a client at the server for that redirect URI and enters its client ID and secret on the connection request’s page, which shows the exact URI. Entering it takes manageOAuthClients on the org. Until then, authorizing fails with OAuthClientRequired (409), which names the issuer. Every later sign-in at that server uses the org’s client. A client_credentials method connects at once with the client’s own credentials, with no sign-in redirect. Forge never registers a client for it, so unless Forge manages a client for that server, someone enters one with a secret first.
The API serves the org’s clients at /orgs/:org_id/oauth-clients. A member with manageOAuthClients can enter the first client for an issuer. Only the person who entered it or an org owner can replace or delete it, because every connection that it signed stops renewing until the same client is entered again. Connections signed by a client with another client ID need connecting again. forge connections list-oauth-clients lists the clients without their secrets, and forge connections delete-oauth-client deletes one.