Skip to content

Workspace single sign-on

A workspace can use its own OpenID Connect identity provider (IdP). Members link their IdP identity to their Mayadyn account once (GET /v1/auth/sso/<slug>/start?link=1 from their own session), then sign in through it. The sign-in flow is in Sign-in and account; the rule that makes it mandatory (require_sso) is in Workspace.

Whoever runs the IdP can sign in as every member who linked it, so only owners configure it.

Register this redirect URI in the IdP: https://console.mayadyn.com/v1/auth/sso/callback. Mayadyn asks for scopes openid email profile, uses the authorization code flow with PKCE (S256), and verifies the ID token’s signature, audience (client_id), issuer and nonce.

Show the settings, without the client secret.

Auth: scope read; not a project token.

Response 200 (WorkspaceSSO):

{"issuer": "https://login.acme.example", "client_id": "mayadyn-console",
"allowed_domains": ["acme.example"]}

Errors: 404 “single sign-on settings not found” (none configured).

Create or replace the workspace’s IdP.

Auth: session only, signed in as yourself (not a token, not a workspace-SSO session); role owner (others: 403 “only owners can change the workspace’s single sign-on”).

Request body (WorkspaceSSO)

Field Type Required Description
issuer string yes https:// issuer URL serving /.well-known/openid-configuration; must resolve to a public address
client_id string yes
client_secret string yes write-only; stored encrypted with the workspace key, never returned
allowed_domains string[] no email domains allowed to sign in (lowercased). Empty or omitted: no restriction
{"issuer": "https://login.acme.example", "client_id": "mayadyn-console",
"client_secret": "s3cr3t-from-the-idp", "allowed_domains": ["acme.example"]}

Response 204.

Errors

Status Code When
400 invalid_input “issuer (https), client_id and client_secret are required”
502 provider_error “the identity provider could not be reached”, hint “Check the issuer URL: it must be a public https address serving /.well-known/openid-configuration.” (discovery is fetched before saving, 15 s timeout; private, loopback and link-local addresses are refused)
403 permission_denied token, workspace-SSO session, or not owner

Notes: links made with a previous issuer do not carry over (identities are keyed by workspace and issuer); members link again. Audit: tenant.sso (issuer, client_id, allowed_domains; never the secret).

Terminal window
curl -s -b jar -X PUT "$MAYADYN/v1/tenant/sso" \
-H "X-Mayadyn-Tenant: acme" -H "X-Mayadyn-CSRF: 1" -H "Content-Type: application/json" \
-d '{"issuer":"https://login.acme.example","client_id":"mayadyn-console","client_secret":"...","allowed_domains":["acme.example"]}'

Remove the workspace’s IdP.

Auth: role owner, signed in as yourself: not a token and not a workspace-SSO session (as for PUT). While the workspace requires SSO, turn that rule off first (PATCH /v1/tenant), then remove the IdP from a password or Google/Microsoft session.

Response 204.

Errors: 409 conflict “the workspace requires single sign-on”, hint “Turn that rule off first.”; 403 permission_denied.

Audit: tenant.sso with removed: true.