For a full walkthrough of the Connector flow including the consent UI, delegated JWT payload, and server-side enforcement, see the Connector guide.
buildConnectorUrl(config, params)
Builds the URL to start the Connector consent flow at https://aveid.net/connect.
string
required
Your app’s client ID (the source app).
string
required
The registered redirect URI the user will be sent to after granting.
string
required
The target resource key (as registered in the developer portal by the target app).
string
required
The resource scope(s) to request. Space-separated if multiple. Must be scopes defined by the target resource.
string
CSRF protection token. Store and verify on the callback.
string
default:"\"user_present\""
"user_present" for interactive consent; "background" for automated/background access.exchangeDelegatedToken(config, payload)
Exchanges a source app access_token_jwt for a short-lived delegated token scoped to the target resource. This is an OAuth token-exchange grant (urn:ietf:params:oauth:grant-type:token-exchange), not a PKCE flow.
string
required
The
access_token_jwt from the source app’s token response. Not the opaque access_token. The server validates this JWT to identify the user and client.string
required
The target resource key.
string
required
The scope(s) to include in the delegated token. Must be a subset of what the user granted.
Client helper
Import from@ave-id/sdk/client. Browser-only.
startConnectorFlow(params)
Generates PKCE params, saves state to sessionStorage, and redirects the user to the Connector consent page.
ave_connector_state to sessionStorage. Read it back on your callback page and verify it matches the state parameter returned in the callback URL before exchanging the delegated token.
Server helper
Import from@ave-id/sdk/server. Server runtime only — requires clientSecret.
exchangeDelegatedTokenServer(config, payload)
Server-side token exchange for Connector flows. Use this for confidential clients.
Grant management
These functions require an Ave session token (not an app token) and are for user-facing grant management flows.listDelegations(config, sessionToken)
Lists active delegation grants for the authenticated user’s session.
revokeDelegation(config, sessionToken, delegationId)
Revokes a delegation grant. After revocation, exchangeDelegatedToken fails for that grant until the user re-authorizes.
