Authentication & Security
API keys, OAuth 2.0, SSO with SAML/OIDC, RBAC, secrets vault, and audit controls.
Authentication Methods
FlowOS supports three ways to authenticate API requests:
- •Bearer tokens — Long-lived API keys generated from the UI or token endpoint. Best for server-to-server integrations.
- •OAuth 2.0 — Short-lived access tokens with refresh tokens. Best for user-facing applications.
- •Session cookies — Browser-based sessions set after SSO or password login. Used by the FlowOS UI only.
API Keys
/api/v1/auth/tokensList all API tokens for the current user
/api/v1/auth/tokensCreate a new API token
/api/v1/auth/tokens/:idRevoke an API token immediately
/api/v1/auth/tokens/rotateIssue a new token and revoke the old one atomically
Create a scoped token
POST /api/v1/auth/tokens
{
"name": "GitHub Actions — deploy pipeline",
"expiresIn": "365d", // or "30d", "90d", null for non-expiring
"scopes": [
"workflows:read",
"workflows:trigger",
"deployments:create",
"apps:deploy"
],
"ipAllowlist": ["203.0.113.0/24"] // optional — restrict by IP CIDR
}
// Response
{
"data": {
"id": "tok_01HZ...",
"name": "GitHub Actions — deploy pipeline",
"token": "fos_live_4k2Xm9...", // only shown ONCE — store immediately
"scopes": ["workflows:read", "workflows:trigger", "deployments:create", "apps:deploy"],
"expiresAt": "2027-06-01T00:00:00Z",
"createdAt": "2026-06-01T00:00:00Z"
}
}token value is shown only once at creation time. Store it securely in your CI/CD secrets or environment variables. If you lose it, rotate the token — the old one will be revoked immediately.OAuth 2.0
Use OAuth 2.0 when building applications that act on behalf of FlowOS users. FlowOS implements the Authorization Code with PKCE flow.
Step 1 — Register your application
POST /api/v1/oauth/applications
{
"name": "Acme Mobile App",
"redirectUris": ["https://mobile.acme.com/auth/callback"],
"allowedScopes": ["incidents:read", "incidents:write", "profile"]
}
// Response
{
"data": {
"clientId": "oauth_client_01HZ...",
"clientSecret": "oauth_sec_...", // store securely, shown once
"redirectUris": ["https://mobile.acme.com/auth/callback"]
}
}Step 2 — Redirect to authorization endpoint
GET https://acme.flowos.io/oauth/authorize
?response_type=code
&client_id=oauth_client_01HZ...
&redirect_uri=https://mobile.acme.com/auth/callback
&scope=incidents:read+incidents:write+profile
&state=random-csrf-token
&code_challenge=BASE64URL(SHA256(code_verifier))
&code_challenge_method=S256Step 3 — Exchange code for tokens
POST /api/v1/oauth/token
{
"grant_type": "authorization_code",
"code": "auth_code_from_redirect",
"redirect_uri": "https://mobile.acme.com/auth/callback",
"client_id": "oauth_client_01HZ...",
"code_verifier": "original-code-verifier"
}
// Response
{
"access_token": "fos_access_...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "fos_refresh_...",
"scope": "incidents:read incidents:write profile"
}Refresh an access token
POST /api/v1/oauth/token
{
"grant_type": "refresh_token",
"refresh_token": "fos_refresh_...",
"client_id": "oauth_client_01HZ..."
}Single Sign-On (SSO)
FlowOS supports SSO via SAML 2.0 and OIDC (OpenID Connect). SSO is configured at workspace level. Once SSO is configured, users are redirected to your identity provider on login.
Configure SAML 2.0
POST /api/v1/settings/sso
{
"protocol": "saml2",
"entityId": "https://acme.flowos.io/sso/saml/metadata",
"ssoUrl": "https://acme.okta.com/app/flowos/sso/saml",
"certificate": "MIIC...base64...cert==",
"attributeMapping": {
"email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"firstName": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"lastName": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
"role": "https://acme.com/claims/flowos_role"
},
"jitProvisioning": true, // auto-create users on first SSO login
"defaultRole": "operator",
"enforceSSO": false // true = disable password login for all users
}Configure OIDC
POST /api/v1/settings/sso
{
"protocol": "oidc",
"issuer": "https://accounts.google.com",
"clientId": "1234567890-abc.apps.googleusercontent.com",
"clientSecret": "GOCSPX-...",
"scopes": ["openid", "email", "profile"],
"claimsMapping": {
"email": "email",
"name": "name"
},
"jitProvisioning": true,
"defaultRole": "developer"
}MFA
FlowOS supports TOTP (Google Authenticator, Authy) and WebAuthn (hardware keys, Touch ID, Face ID) as second factors.
/api/v1/auth/mfa/statusGet MFA enrollment status for current user
/api/v1/auth/mfa/totp/enrollBegin TOTP enrollment — returns QR code URI
/api/v1/auth/mfa/totp/verifyVerify TOTP code to complete enrollment
/api/v1/auth/mfa/webauthn/registerRegister a WebAuthn credential
/api/v1/settings/security/enforce-mfaRequire MFA for all workspace users (admin only)
Secrets Vault
The FlowOS vault stores secrets (API keys, passwords, connection strings) encrypted at rest. Secrets are referenced in workflow node config as {{secrets.MY_SECRET}} — they are never logged or returned in API responses.
/api/v1/secretsList secret names (values never returned)
/api/v1/secretsStore a new secret
/api/v1/secrets/:nameUpdate (rotate) a secret value
/api/v1/secrets/:nameDelete a secret
POST /api/v1/secrets
{
"name": "PAGERDUTY_KEY",
"value": "pd_live_...",
"description": "PagerDuty Events API v2 key"
}
// Secrets are referenced in workflow nodes as:
// "apiKey": "{{secrets.PAGERDUTY_KEY}}"PUT /api/v1/secrets/:name. The new value takes effect immediately for all workflows and artifacts that reference it — no redeployment needed.RBAC — Roles & Permissions
/api/v1/settings/rolesList all roles (built-in and custom)
/api/v1/settings/rolesCreate a custom role
/api/v1/settings/roles/:idGet role with permission list
/api/v1/settings/roles/:idUpdate role permissions
POST /api/v1/settings/roles
{
"name": "ITSM Analyst",
"description": "Can view and manage ITSM records; cannot access studios",
"permissions": [
"incidents:read",
"incidents:write",
"incidents:resolve",
"changes:read",
"problems:read",
"knowledge:read",
"knowledge:write",
"cmdb:read"
]
}Assign a role to a user
POST /api/v1/settings/users/:userId/roles
{
"roleId": "rol_itsm_analyst",
"workspaceId": "ws_acme" // optional for multi-workspace accounts
}