Save a company’s identity provider settings
const url = 'https://beta-api.plune.ai/v1/companies/example/sso';const options = { method: 'PUT', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"idpEntityId":"https://idp.example.com/entity","idpSsoUrl":"https://idp.example.com/sso","idpCerts":["-----BEGIN CERTIFICATE-----\nMIIC8DCCAdigAwIBAgIIa83dSIfL7OUwDQYJKoZIhvcNAQELBQAwODE2MDQGA1UE\nAwwtaWRwLmV4YW1wbGUuY29tIChQbHVuZSBkb2N1bWVudGF0aW9uIGV4YW1wbGUp\nMB4XDTI2MDEwMTAwMDAwMFoXDTQ1MTIyNzAwMDAwMFowODE2MDQGA1UEAwwtaWRw\nLmV4YW1wbGUuY29tIChQbHVuZSBkb2N1bWVudGF0aW9uIGV4YW1wbGUpMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAreuGfj5XYZ/QC8RMQdt/2hKSNwNZ\nF+0b3EGTN2Lr/o0MKPA9Ozqjs2oUNQ5/b6w9EPH190JlLb+FKQhrXjyor4WNvcZo\niYhkwdeEDuibUAd6ikwub37NYsVx/Y/XRux3H59Mfovsg2QYYljkJsR0Qp1KAc+2\nYFLRu5cJcyz1V2SBwI0AY99BWdi/ACNFfiQOAR4U1o8KnoXo6Hm5jZSZBxWS8Wl2\nqp4YeBsFY/uSA4QKPZ1ifjdYwjjUlfJUP0nAhtpMHD6oCz5+CLTn1cOB+75yeekA\n96LZr5tzp33PShbqKykQVpFC/Nf71u5jLjHvlvQ6tCf1/y/Oty2HT8pToQIDAQAB\nMA0GCSqGSIb3DQEBCwUAA4IBAQB7qf6Bzo54E1TzZWhtUNt8iosOBPEqM0zi8raf\nUo9gmOmnitsWegKIy1Ri6okX9JDPjXbxM+Ev7qDp3m9ioPNcwYJL4mE4vD5uCj8V\ngc3HcPGKm7kUSlfZidLVUXa0oH8LlHTh+1FbCCv2KXyVFF5f9YfcZ8eYet+zWEtA\ng/IueYChpHq0L5f0ZckLc47yeDbxJWs/voIKxwR9JFXMglHloHIwuYha2nKdXIza\nKUoFFR5AwCzCqY/qnEE5yRDzCLitoXsCu4vcpwTJynBRTtEdgMwfmQxnJ3KJ0dJx\npT8NlVkLznKwmfIjr32Qnb2etsZEbD1jRzAirS88v85sA47X\n-----END CERTIFICATE-----\n"],"enabled":true,"jit":true,"defaultRole":"member"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://beta-api.plune.ai/v1/companies/example/sso \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \ --data '{ "idpEntityId": "https://idp.example.com/entity", "idpSsoUrl": "https://idp.example.com/sso", "idpCerts": [ "-----BEGIN CERTIFICATE-----\nMIIC8DCCAdigAwIBAgIIa83dSIfL7OUwDQYJKoZIhvcNAQELBQAwODE2MDQGA1UE\nAwwtaWRwLmV4YW1wbGUuY29tIChQbHVuZSBkb2N1bWVudGF0aW9uIGV4YW1wbGUp\nMB4XDTI2MDEwMTAwMDAwMFoXDTQ1MTIyNzAwMDAwMFowODE2MDQGA1UEAwwtaWRw\nLmV4YW1wbGUuY29tIChQbHVuZSBkb2N1bWVudGF0aW9uIGV4YW1wbGUpMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAreuGfj5XYZ/QC8RMQdt/2hKSNwNZ\nF+0b3EGTN2Lr/o0MKPA9Ozqjs2oUNQ5/b6w9EPH190JlLb+FKQhrXjyor4WNvcZo\niYhkwdeEDuibUAd6ikwub37NYsVx/Y/XRux3H59Mfovsg2QYYljkJsR0Qp1KAc+2\nYFLRu5cJcyz1V2SBwI0AY99BWdi/ACNFfiQOAR4U1o8KnoXo6Hm5jZSZBxWS8Wl2\nqp4YeBsFY/uSA4QKPZ1ifjdYwjjUlfJUP0nAhtpMHD6oCz5+CLTn1cOB+75yeekA\n96LZr5tzp33PShbqKykQVpFC/Nf71u5jLjHvlvQ6tCf1/y/Oty2HT8pToQIDAQAB\nMA0GCSqGSIb3DQEBCwUAA4IBAQB7qf6Bzo54E1TzZWhtUNt8iosOBPEqM0zi8raf\nUo9gmOmnitsWegKIy1Ri6okX9JDPjXbxM+Ev7qDp3m9ioPNcwYJL4mE4vD5uCj8V\ngc3HcPGKm7kUSlfZidLVUXa0oH8LlHTh+1FbCCv2KXyVFF5f9YfcZ8eYet+zWEtA\ng/IueYChpHq0L5f0ZckLc47yeDbxJWs/voIKxwR9JFXMglHloHIwuYha2nKdXIza\nKUoFFR5AwCzCqY/qnEE5yRDzCLitoXsCu4vcpwTJynBRTtEdgMwfmQxnJ3KJ0dJx\npT8NlVkLznKwmfIjr32Qnb2etsZEbD1jRzAirS88v85sA47X\n-----END CERTIFICATE-----\n" ], "enabled": true, "jit": true, "defaultRole": "member" }'Owner only. The provider’s fields are sent whole; the switches are left as they are when absent. enabled needs a verified domain; enforced needs it enabled and the owner’s own sign-in through the provider (409 sso_test_login_required until then): the owner keeps the email link as an audited emergency way in, and the application owner can switch the requirement off. Changing the provider’s entity id or address lifts the requirement. Every change is a row of the company’s log. 20 a minute a person.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”object
The identity provider’s entity id (its Issuer).
Its single sign-on address; https only.
Its PUBLIC certificates, PEM or the base64 body alone. Send the old one with the new one while the provider rotates, then the new one alone. A private key is refused.
Needs a verified domain.
Single sign-on required: needs it enabled, a verified domain, and the owner’s own sign-in through the provider.
What a person who signs in for the first time joins as. Never manager or owner.
Add people of a verified domain to the company at their first sign-in. Off unless asked: then it only proves who they are, and the company lets in the members and the invited.
The attribute that holds the address when it is not the NameID.
The attribute that holds the display name; used only where the person has none.
For a provider that demands signed requests: the server makes a key pair for the company (the private key is sealed and never returned). 503 when the server has no SSO_ENCRYPTION_KEY.
With the requirement on after this save: also revoke every API token of the people on the verified domains, in the same transaction (default false: tokens made before stay valid). Recorded in the company’s log; the count is tokensRevoked in the answer.
Example
{ "idpE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dJx\npT8NlVkLznKwmfIjr32Qnb2etsZEbD1jRzAirS88v85sA47X\n-----END CERTIFICATE-----\n" ], "enabled": true, "jit": true, "defaultRole": "member"}Responses
Section titled “ Responses ”The settings after the save
The owner reads everything below; a manager reads configured, enabled, enforced and, per domain, domain and verified - no value.
object
What to enter at the identity provider.
object
The bookmark for the provider’s application tile; null until a domain is verified.
object
object
The company’s public certificate for signed requests; there is no private key to read.
The owner has signed in through this provider: what «required» waits for.
Only in the answer to a save that sent revokeTokens: how many tokens it revoked (0 when the requirement is not on after it).
object
The DNS TXT record that proves the domain: put value in a TXT record at name, then ask for the verification.
object
Example
{ "defaultRole": "member", "domains": [ { "domain": "acme.example", "record": { "type": "TXT", "name": "_plune-sso.acme.example", "value": "plune-sso-verification=Zt3b…" } } ]}A field is not valid, or a certificate is not a certificate
object
Example generated
{ "error": "example"}No / invalid session
The company does not have the saml option (code: tier_option_required, option: saml): a Team plan with the option, or Enterprise. Also: the caller is not the owner (or, for the read, a manager)
object
Example generated
{ "error": "example"}No such company, or the caller is not in it
object
Example generated
{ "error": "example"}sso_domain_required, sso_enabled_required or sso_test_login_required: what is missing first
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over
Signed requests are not available on this server
object
Example generated
{ "error": "example"}