Set up single sign-on
const url = 'http://localhost:3000/api/v1/sso';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"issuer":"https://example.com","clientId":"example","clientSecret":"example","domain":"example","projectId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:3000/api/v1/sso \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "issuer": "https://example.com", "clientId": "example", "clientSecret": "example", "domain": "example", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'One OpenID Connect provider (Okta, Entra ID, Google Workspace…) for the people at one email domain. Register redirectUri with the provider first, then save its issuer and client here: the endpoints are read from the issuer’s discovery document now, and a 422 says what was wrong with it. Add the TXT record in record, then POST /api/v1/sso/verify. From then on anyone at the domain signs in through the provider and joins the organization able to read projectId (the oldest project when null). A new domain is proved again; one another organization proved is refused.
Scope: admin.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The provider’s issuer URL: its discovery document is read from {issuer}/.well-known/openid-configuration
The app’s client ID at the provider
The app’s client secret. Needed to set it up; left out on a change, the one kept stays
The email domain its people sign in with, e.g. acme.com. Proved by a TXT record
Examplegenerated
{ "issuer": "https://example.com", "clientId": "example", "clientSecret": "example", "domain": "example", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”Single sign-on
object
object
The domain is proved: its people sign in through the provider
Addresses at the domain sign in only through the provider, but for the organization’s admins
The project its people land in the first time, able to read; null for the organization’s oldest
What proves the domain: add this record at your DNS host
object
Register this with the provider as the app’s redirect URI
Example
{ "data": { "record": { "type": "TXT" } }}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}