Skip to content

Overview

OAuth 2.1 authorization for Mindflow user access on the Platform API. Access tokens are opaque bearer tokens. A token can only use the environments and flows the user approved, and only up to the role ceiling they chose.

Discovery, registration, authorize, and token exchange do not use a bearer token. POST /oauth/session and POST /oauth/configure send the signed-in user’s identity JWT as Authorization: Bearer <token> (not a body field). Listing and revoking grants uses that same identity JWT. Browser callers use CORS (OPTIONS preflight) on those Studio-facing routes. GET /oauth/whoami accepts that identity JWT or an opaque access token from the token endpoint.

Order of calls

  1. GET /.well-known/oauth-authorization-server for the authorization and token URLs (RFC 8414).
  2. POST /oauth/register to register the client redirect URIs (RFC 7591). Authorization code with PKCE (S256) is the only grant.
  3. GET /oauth/authorize with response_type=code, code_challenge_method=S256, code_challenge, redirect_uri, client_id, and state. The response is 302 to Studio consent with #bind= in the fragment.
  4. POST /oauth/session with Authorization: Bearer <identity JWT> and body { "bindToken" }. Finish this within 30 minutes of the authorize redirect. The response lists environments and flows the user may approve. 503 when there are too many to list.
  5. POST /oauth/configure with the same identity JWT and the chosen environment and flow ceilings. One configure call consumes the bind token. The body returns redirectUrl with code and state.
  6. POST /oauth/token (application/x-www-form-urlencoded) within 60 seconds of configure. Send code and code_verifier (PKCE), or a refresh_token. Present the opaque access token as Authorization: Bearer <token> on Platform REST routes that accept user tokens and on GET /oauth/whoami.

Limits

  • code_challenge_method must be S256. code_challenge is 43 unreserved characters. code_verifier is 43 to 128 unreserved characters (A-Z, a-z, 0-9, -, ., _, ~).
  • access_token lasts 3600 seconds. expires_in is that number of seconds.
  • refresh_token lasts 14 days. Each successful refresh returns a new refresh token. Send that new value next time. A refresh token that was already replaced is rejected. Using a replaced token again after 30 seconds revokes the approval.
  • A registered client stays valid for one year. client_name is at most 128 characters.

GET /oauth/whoami returns the signed-in user and the environments and flows the token can use. Organization-scoped grant list, edit, and revoke use /organizations/{organizationId}/oauth/grants. Root administrators list every organization with GET /oauth/grants?forUserId=all. Later calls that present a token from a revoked approval fail authentication.

Field names

Environment access uses unprefixed fields (scope, maximumRole) and environment* for collections (environmentIds, environmentRows, environmentRoles). Flow access always uses the flow* prefix (flowScope, flowMaximumRole, flowIds, flowRows, flowRoles).

scope and flowScope are all, selected, or none. selected requires the matching id list. none grants no resources of that kind. Role values are environmentAuditor, environmentOperator, environmentOwner, and flowAuditor, flowEditor, flowOwner. A requested role is lowered to the strongest role the user already holds.

Information

Bearer token for API authentication. The token must be provided in the Authorization header as ‘Bearer ’.

Security scheme type: http