Skip to content

Commit 9d84a7a

Browse files
committed
update identity provider page
1 parent 4e2c94e commit 9d84a7a

File tree

1 file changed

+39
-97
lines changed

1 file changed

+39
-97
lines changed

protected-pages/identity-provider-authentication.mdx

Lines changed: 39 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,39 @@
11
---
22
title: "Identity provider authentication"
3-
description: "Guarantee privacy of your docs by authenticating users"
3+
description: "Keep your docs private by authenticating users"
44
icon: "file-lock"
55
keywords: ['auth', 'authentication']
66
---
77

8-
This guide covers setup for each available handshake method to control access to your documentation.
8+
Control access to your documentation by authenticating individual users.
99

1010
<Info>
1111
Authentication methods are available on [Growth and Enterprise plans](https://mintlify.com/pricing?ref=authentication).
1212
</Info>
1313

14-
## Protected pages setup
14+
## Choose your method
1515

16-
TODO: verify steps with new UI
16+
**Use JWT if**:
17+
18+
- You want full control over the login flow and user data.
19+
- You need custom authentication logic.
20+
- You prefer to manage tokens yourself.
21+
22+
**Use OAuth 2.0 if**:
23+
24+
- You want to integrate with third-party providers (Google, GitHub, etc.).
25+
- You want to leverage existing OAuth infrastructure.
26+
- You prefer standardized security protocols.
1727

18-
Select the handshake method that you want to configure.
28+
**Use the Mintlify dashboard if**:
29+
30+
- Your editors are also your documentation users.
31+
- You want a zero configuration setup.
32+
33+
## Configuration
34+
35+
Select the method that you want to configure.
36+
TODO: verify steps with new UI
1937

2038
<Tabs>
2139
<Tab title="JWT">
@@ -28,25 +46,24 @@ Select the handshake method that you want to configure.
2846

2947
<Steps>
3048
<Step title="Generate a private key.">
31-
1. In your dashboard, go to [Authentication](https://dashboard.mintlify.com/settings/deployment/authentication).
32-
2. Select **Full Authentication** or **Partial Authentication**.
33-
3. Select **JWT**.
34-
4. Enter the URL of your existing login flow and select **Save changes**.
35-
5. Select **Generate new key**.
36-
6. Store your key securely where it can be accessed by your backend.
49+
1. In your dashboard, go to [Protected pages](https://dashboard.mintlify.com/settings/deployment/authentication).
50+
2. Select **JWT**.
51+
3. Enter the URL of your existing login flow and select **Save changes**.
52+
4. Select **Generate new key**.
53+
5. Store your key securely where it can be accessed by your backend.
3754
</Step>
3855
<Step title="Integrate Mintlify authentication into your login flow.">
3956
Modify your existing login flow to include these steps after user authentication:
4057

41-
* Create a JWT containing the authenticated user's info in the `User` format. See [Sending Data](/protected-pages/sending-data) for more information.
58+
* TODO: what format is needed? Create a JWT containing the authenticated user's info in the `User` format. See [Sending Data](/protected-pages/sending-data) for more information.
4259
* Sign the JWT with your secret key, using the EdDSA algorithm.
4360
* Create a redirect URL back to the `/login/jwt-callback` path of your docs, including the JWT as the hash.
4461
</Step>
4562
</Steps>
4663

4764
### Example
4865

49-
Your documentation is hosted at `docs.foo.com` with an existing authentication system at `foo.com`. You want to extend your login flow to grant access to the docs while keeping your docs separate from your dashboard (or you don't have a dashboard).
66+
Your documentation is hosted at `docs.foo.com` with an existing authentication system at `foo.com`. You want to extend your login flow to grant access to the docs while keeping your docs separate from your dashboard.
5067

5168
Create a login endpoint at `https://foo.com/docs-login` that extends your existing authentication.
5269

@@ -124,15 +141,14 @@ When an unauthenticated user tries to access a protected page, their intended de
124141
### Prerequisites
125142

126143
* An OAuth server that supports the Authorization Code Flow.
127-
* Ability to create an API endpoint accessible by OAuth access tokens (optional, to enable API prefilling features).
128144

129145
### Implementation
130146

131147
<Steps>
132148
<Step title="Configure your OAuth settings.">
133-
1. In your dashboard, go to [Authentication](https://dashboard.mintlify.com/settings/deployment/authentication).
134-
2. Select **Full Authentication** or **Partial Authentication**.
135-
3. Select **OAuth** and configure these fields:
149+
1. In your dashboard, go to [Protected pages](https://dashboard.mintlify.com/settings/deployment/authentication).
150+
2. Select **OAuth 2.0**.
151+
3. Configure these fields:
136152
* **Authorization URL**: Your OAuth endpoint.
137153
* **Client ID**: Your OAuth 2.0 client identifier.
138154
* **Client Secret**: Your OAuth 2.0 client secret.
@@ -148,7 +164,7 @@ When an unauthenticated user tries to access a protected page, their intended de
148164
<Step title="Create your user info endpoint (optional).">
149165
To enable API playground prefilling, create an API endpoint that:
150166
* Accepts OAuth access tokens for authentication.
151-
* Returns user data in the `User` format. See [Sending Data](/protected-pages/sending-data) for more information.
167+
* TODO: what data format is needed?Returns user data in the `User` format. See [Sending Data](/protected-pages/sending-data) for more information.
152168

153169
Add this endpoint URL to the **Info API URL** field in your [authentication settings](https://dashboard.mintlify.com/settings/deployment/authentication).
154170
</Step>
@@ -179,19 +195,18 @@ Your documentation is hosted at `foo.com/docs` and you have an existing OAuth se
179195

180196
**Configure your OAuth server to allow redirects** to your callback URL.
181197
</Tab>
182-
<Tab title="Mintlify Dashboard">
198+
<Tab title="Mintlify dashboard">
183199
### Prerequisites
184200

185-
* Your documentation users are also your documentation editors.
201+
* Your documentation users are also your editors.
186202

187203
### Implementation
188204

189205
<Steps>
190206
<Step title="Enable Mintlify dashboard authentication.">
191-
1. In your dashboard, go to [Authentication](https://dashboard.mintlify.com/settings/deployment/authentication).
192-
2. Select **Full Authentication** or **Partial Authentication**.
193-
3. Select **Mintlify Auth**.
194-
4. Select **Enable Mintlify Auth**.
207+
1. In your dashboard, go to [Protected pages](https://dashboard.mintlify.com/settings/deployment/authentication).
208+
2. Select **Mintlify dashboard**.
209+
3. Select **Enable Mintlify dashboard**.
195210
</Step>
196211
<Step title="Add authorized users.">
197212
1. In your dashboard, go to [Members](https://dashboard.mintlify.com/settings/organization/members).
@@ -208,77 +223,4 @@ Your documentation is hosted at `docs.foo.com` and your team uses the dashboard
208223

209224
**Verify team access** by checking that all team members are added to your organization.
210225
</Tab>
211-
<Tab title="Shared session">
212-
### Prerequisites
213-
TODO: verify this is still an option
214-
215-
* A dashboard or user portal with cookie-based session authentication.
216-
* Ability to create an API endpoint at the same origin or subdomain as your dashboard.
217-
* If your dashboard is at `foo.com`, the **API URL** must start with `foo.com` or `*.foo.com`.
218-
* If your dashboard is at `dash.foo.com`, the **API URL** must start with `dash.foo.com` or `*.dash.foo.com`.
219-
* Your docs are hosted at the same domain or subdomain as your dashboard.
220-
* If your dashboard is at `foo.com`, your **docs** must be hosted at `foo.com` or `*.foo.com`.
221-
* If your dashboard is at `*.foo.com`, your **docs** must be hosted at `foo.com` or `*.foo.com`.
222-
223-
### Implementation
224-
225-
<Steps>
226-
<Step title="Create user info API endpoint.">
227-
Create an API endpoint that:
228-
* Uses your existing session authentication to identify users
229-
* Returns user data in the `User` format (see [Sending Data](/protected-pages/sending-data))
230-
* If the API domain and the docs domain **do not exactly match**:
231-
* Add the docs domain to your API's `Access-Control-Allow-Origin` header (must not be `*`).
232-
* Set your API's `Access-Control-Allow-Credentials` header to `true`.
233-
234-
<Warning>
235-
Only enable CORS headers on this specific endpoint, not your entire dashboard API.
236-
</Warning>
237-
</Step>
238-
<Step title="Configure your settings.">
239-
1. In your dashboard, go to [Authentication](https://dashboard.mintlify.com/settings/deployment/authentication).
240-
2. Select **Personalization**.
241-
3. Select **Shared Session**.
242-
4. Enter your **Info API URL**, which is the endpoint from the first step.
243-
5. Enter your **Login URL**, where users log into your dashboard.
244-
6. Select **Save changes**.
245-
</Step>
246-
</Steps>
247-
248-
### Examples
249-
250-
#### Dashboard at subdomain, docs at subdomain
251-
252-
You have a dashboard at `dash.foo.com`, which uses cookie-based session authentication. Your dashboard API routes are hosted at `dash.foo.com/api`. You want to set up personalization for your docs hosted at `docs.foo.com`.
253-
254-
**Setup process**:
255-
1. **Create endpoint** `dash.foo.com/api/docs/user-info` that identifies users via session authentication and responds with their user data.
256-
2. **Add CORS headers** for this route only:
257-
* `Access-Control-Allow-Origin`: `https://docs.foo.com`
258-
* `Access-Control-Allow-Credentials`: `true`
259-
3. **Configure API URL** in authentication settings: `https://dash.foo.com/api/docs/user-info`.
260-
261-
#### Dashboard at subdomain, docs at root
262-
263-
You have a dashboard at `dash.foo.com`, which uses cookie-based session authentication. Your dashboard API routes are hosted at `dash.foo.com/api`. You want to set up personalization for your docs hosted at `foo.com/docs`.
264-
265-
**Setup process**:
266-
1. **Create endpoint** `dash.foo.com/api/docs/user-info` that identifies users via session authentication and responds with their user data.
267-
2. **Add CORS headers** for this route only:
268-
* `Access-Control-Allow-Origin`: `https://foo.com`
269-
* `Access-Control-Allow-Credentials`: `true`
270-
3. **Configure API URL** in authentication settings: `https://dash.foo.com/api/docs/user-info`.
271-
272-
#### Dashboard at root, docs at root
273-
274-
You have a dashboard at `foo.com/dashboard`, which uses cookie-based session authentication. Your dashboard API routes are hosted at `foo.com/api`. You want to set up personalization for your docs hosted at `foo.com/docs`.
275-
276-
**Setup process**:
277-
1. **Create endpoint** `foo.com/api/docs/user-info` that identifies users via session authentication and responds with their user data.
278-
2. **Configure API URL** in authentication settings: `https://foo.com/api/docs/user-info`
279-
280-
<Note>
281-
No CORS configuration is needed since the dashboard and docs share the same domain.
282-
</Note>
283-
</Tab>
284226
</Tabs>

0 commit comments

Comments
 (0)