Skip to content

Commit a16770f

Browse files
authored
Add docs on self-hosted enablement of management api (#110)
1 parent 05d4cd0 commit a16770f

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

fern/pages/self-hosting.mdx

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ online at [app.ssoready.com](https://app.ssoready.com). This article explains ho
99
instead of using the public, free version of SSOReady at [app.ssoready.com](https://app.ssoready.com).
1010

1111
<Tip>
12-
This article focuses on running SSOReady in your own cloud. You can also run SSOReady in your customer's cloud, so that
13-
SSOReady becomes a component of your larger on-premises offering to your customers; the only difference is that you'll
14-
need to follow these instructions for each customer.
12+
This article focuses on running SSOReady in your own cloud. You can also run SSOReady in your customer's cloud, so that
13+
SSOReady becomes a component of your larger on-premises offering to your customers; the only difference is that you'll
14+
need to follow these instructions for each customer.
1515
</Tip>
1616

1717
# SSOReady Components
@@ -166,7 +166,7 @@ by using a new random, 64-digit hex number.
166166
## `id_token` Signing Key
167167

168168
<Note>
169-
This section is only required if you use [SAML-over-OAuth](/docs/saml-over-oauth-saml-nextauth-integration).
169+
This section is only required if you use [SAML-over-OAuth](/docs/saml-over-oauth-saml-nextauth-integration).
170170
</Note>
171171

172172
SSOReady's SAML-over-OAuth integration has `ssoready-auth` act as an OIDC-compliant server. Such servers need to issue
@@ -256,32 +256,60 @@ for creating an OAuth app](https://learn.microsoft.com/en-us/entra/identity-plat
256256
* The app's "Application (Client) ID", a UUID, is what you use for `API_MICROSOFT_OAUTH_CLIENT_ID` and `APP_MICROSOFT_OAUTH_CLIENT_ID`.
257257
* Create a "client secret" credential (Microsoft documents this [here](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=client-secret#add-credentials) under the "Add a client secret" tab). The secret's value is what you put in `API_MICROSOFT_OAUTH_CLIENT_SECRET`.
258258

259+
## Enabling the Management API
260+
261+
The [SSOReady Management API](/docs/management-api) lets you programmatically
262+
automate everything that would otherwise require a human to click around in the
263+
SSOReady web application. If you don't need the Management API, skip this
264+
section.
265+
266+
To enable the Management API in a self-hosted instance of SSOReady, you must
267+
first log into the SSOReady web application a first time. That will create a
268+
`app_organizations` row in the SSOReady database, upon which you can enable the
269+
Management API.
270+
271+
Once you have logged into SSOReady, you can next connect to your your SSOReady
272+
database (using `psql` or any other tool you're comfortable with), and run:
273+
274+
```sql
275+
update app_organizations set entitled_management_api = true where id = '...';
276+
```
277+
278+
To determine the appropriate `id` to run in the SQL command above, you may run:
279+
280+
```sql
281+
select * from app_organizations;
282+
```
283+
284+
In the common case where nobody else has logged into the SSOReady web
285+
application, there will only be one `app_organizations` row to choose from.
286+
259287
# Configuring SDKs to talk to self-hosted SSOReady instances
260288

261289
By default, the SSOReady SDKs expect to talk to `https://api.ssoready.com`. When you're running SSOReady self-hosted,
262290
you need to point it to your own instance of `ssoready-api`. Here's how you do that, supposing your `ssoready-api` lives
263291
at `localhost:8081` like in the example above:
264292

265293
<CodeBlocks>
266-
```typescript title="TypeScript"
267-
import { SSOReadyClient } from "ssoready";
294+
```typescript title="TypeScript"
295+
import { SSOReadyClient } from "ssoready";
268296

269-
const ssoready = new SSOReadyClient({
297+
const ssoready = new SSOReadyClient({
270298
// add this new `environment` parameter
271299
environment: "http://localhost:8081",
272300
apiKey: "ssoready_sk_...",
273301
});
274-
```
302+
```
275303

276-
```python title="Python"
277-
from ssoready.client import SSOReady
304+
```python title="Python"
305+
from ssoready.client import SSOReady
278306

279-
client = SSOReady(
307+
client = SSOReady(
280308
# add this new `base_url` parameter
281309
base_url="http://localhost:8081",
282310
api_key="ssoready_sk_..."
283-
)
284-
```
311+
)
312+
```
285313
</CodeBlocks>
286314

287315
# Running migrations on `ssoready-db`

0 commit comments

Comments
 (0)