Mindflow Support
Overview
Platform user-token OAuth (Beta) 1.0.0
Section titled “Platform user-token OAuth (Beta) 1.0.0”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
GET /.well-known/oauth-authorization-serverfor the authorization and token URLs (RFC 8414).POST /oauth/registerto register the client redirect URIs (RFC 7591). Authorization code with PKCE (S256) is the only grant.GET /oauth/authorizewithresponse_type=code,code_challenge_method=S256,code_challenge,redirect_uri,client_id, andstate. The response is 302 to Studio consent with#bind=in the fragment.POST /oauth/sessionwithAuthorization: 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.POST /oauth/configurewith the same identity JWT and the chosen environment and flow ceilings. One configure call consumes the bind token. The body returnsredirectUrlwithcodeandstate.POST /oauth/token(application/x-www-form-urlencoded) within 60 seconds of configure. Sendcodeandcode_verifier(PKCE), or arefresh_token. Present the opaque access token asAuthorization: Bearer <token>on Platform REST routes that accept user tokens and onGET /oauth/whoami.
Limits
code_challenge_methodmust beS256.code_challengeis 43 unreserved characters.code_verifieris 43 to 128 unreserved characters (A-Z,a-z,0-9,-,.,_,~).access_tokenlasts 3600 seconds.expires_inis that number of seconds.refresh_tokenlasts 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_nameis 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.
Authentication
Section titled “Authentication”bearerAuth
Section titled “bearerAuth”Bearer token for API authentication. The token must be provided in the Authorization header as ‘Bearer
Security scheme type: http