Update app SSO settings

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Sets up or changes the app's own SSO provider, and turns SSO sign-in on for the app. The app's other login methods stay as they are. Turn those off with Update app.

The credentials and URLs you send take effect on the published app right away, including when you switch providers, so a switch can change or break live sign-ins before you deploy. The provider name and SSO being turned on reach the published app once you deploy the app.

Send only the fields you want to change. A field you leave out keeps its stored value, and an empty string clears it. Sending the masked client_secret from Get app SSO settings keeps the stored secret.

Changing name to a different provider deletes everything stored for the previous one, so send the new provider's settings in the same request.

After the save, the app needs a client_id, a client_secret, and either a discovery_url or both an auth_endpoint and a token_endpoint. A request that would leave any of these missing is rejected and nothing is saved.

The discovery_url is fetched before saving. If it can't serve a sign-in, the request is rejected. If the check fails in a way that may be temporary, the settings are saved and the response carries a warning.

Turning SSO on for an app that doesn't use it yet needs a plan that includes SSO for apps. An app that already uses SSO can keep changing its settings.

The settings are stored as the app's secrets whose names start with sso_, and the app's backend functions, if it has any, redeploy to pick them up.

This is limited to 20 requests a minute per caller for each app. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>

put/api/apps/{app_id}/sso/settings

Path parameters

app_idstring required

ID of the app.

ID of the app.

Request body

namestring nullable

Name of the SSO provider. Use google, microsoft, github, or okta for those providers, or a name of your choice for any other OpenID Connect or OAuth provider. Required unless the app already has a provider.

client_idstring nullable

OAuth client ID from the identity provider.

client_secretstring nullable

OAuth client secret from the identity provider. Leave it out to keep the stored one.

discovery_urlstring nullable

OpenID Connect discovery URL. It must be an absolute http or https URL on a public address.

scopestring nullable

Scopes to request at sign-in, separated by spaces.

auth_endpointstring nullable

Authorization endpoint, for a provider without a discovery URL.

token_endpointstring nullable

Token endpoint, for a provider without a discovery URL.

userinfo_endpointstring nullable

User info endpoint, for a provider without a discovery URL.

jwks_uristring nullable

URL of the provider's signing keys, for a custom provider.

tenant_idstring nullable

Microsoft Entra tenant ID, for the microsoft provider.

okta_domainstring nullable

Okta domain, for the okta provider.

Example request

{
  "name": "okta",
  "client_id": "0oa8f2k1xyzAbCdE5d7",
  "client_secret": "kq3Vt1-9dPzLr0aYbN2x",
  "discovery_url": "https://acme.okta.com/.well-known/openid-configuration",
  "scope": "openid email profile",
  "auth_endpoint": "https://github.com/login/oauth/authorize",
  "token_endpoint": "https://github.com/login/oauth/access_token",
  "userinfo_endpoint": "https://api.github.com/user",
  "jwks_uri": "https://idp.acme.com/oauth2/keys",
  "tenant_id": "organizations",
  "okta_domain": "acme.okta.com"
}

Response

The settings were saved.

statusstring required

Always success.

auth_configobject required

The app's sign-in settings as saved, with sso_provider_name set to the provider and enable_sso_login set to true.

warningstring nullable

Why the discovery URL couldn't be checked, present only when that happened. The settings are saved, but SSO sign-in fails while the problem lasts.

Example response

{
  "status": "success",
  "auth_config": {
    "enable_apple_login": false,
    "enable_facebook_login": false,
    "enable_google_login": true,
    "enable_microsoft_login": false,
    "enable_sso_login": true,
    "enable_username_password": false,
    "sso_provider_name": "okta"
  },
  "warning": "The Discovery URL could not be verified because it did not respond in time. SSO login will fail while that persists."
}

Changes

Changed in 1 of the 22 revisions of this API.1

Of the 22 revisions, 1 has no diff computed.