You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: protected-pages/identity-provider-authentication.mdx
+39-97Lines changed: 39 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,39 @@
1
1
---
2
2
title: "Identity provider authentication"
3
-
description: "Guarantee privacy of your docs by authenticating users"
3
+
description: "Keep your docs private by authenticating users"
4
4
icon: "file-lock"
5
5
keywords: ['auth', 'authentication']
6
6
---
7
7
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.
9
9
10
10
<Info>
11
11
Authentication methods are available on [Growth and Enterprise plans](https://mintlify.com/pricing?ref=authentication).
12
12
</Info>
13
13
14
-
## Protected pages setup
14
+
## Choose your method
15
15
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.
17
27
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
19
37
20
38
<Tabs>
21
39
<Tabtitle="JWT">
@@ -28,25 +46,24 @@ Select the handshake method that you want to configure.
28
46
29
47
<Steps>
30
48
<Steptitle="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.
37
54
</Step>
38
55
<Steptitle="Integrate Mintlify authentication into your login flow.">
39
56
Modify your existing login flow to include these steps after user authentication:
40
57
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.
42
59
* Sign the JWT with your secret key, using the EdDSA algorithm.
43
60
* Create a redirect URL back to the `/login/jwt-callback` path of your docs, including the JWT as the hash.
44
61
</Step>
45
62
</Steps>
46
63
47
64
### Example
48
65
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.
50
67
51
68
Create a login endpoint at `https://foo.com/docs-login` that extends your existing authentication.
52
69
@@ -124,15 +141,14 @@ When an unauthenticated user tries to access a protected page, their intended de
124
141
### Prerequisites
125
142
126
143
* 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).
128
144
129
145
### Implementation
130
146
131
147
<Steps>
132
148
<Steptitle="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:
136
152
***Authorization URL**: Your OAuth endpoint.
137
153
***Client ID**: Your OAuth 2.0 client identifier.
138
154
***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
148
164
<Steptitle="Create your user info endpoint (optional).">
149
165
To enable API playground prefilling, create an API endpoint that:
150
166
* 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.
152
168
153
169
Add this endpoint URL to the **Info API URL** field in your [authentication settings](https://dashboard.mintlify.com/settings/deployment/authentication).
154
170
</Step>
@@ -179,19 +195,18 @@ Your documentation is hosted at `foo.com/docs` and you have an existing OAuth se
179
195
180
196
**Configure your OAuth server to allow redirects** to your callback URL.
181
197
</Tab>
182
-
<Tabtitle="Mintlify Dashboard">
198
+
<Tabtitle="Mintlify dashboard">
183
199
### Prerequisites
184
200
185
-
* Your documentation users are also your documentation editors.
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**.
195
210
</Step>
196
211
<Steptitle="Add authorized users.">
197
212
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
208
223
209
224
**Verify team access** by checking that all team members are added to your organization.
210
225
</Tab>
211
-
<Tabtitle="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
-
<Steptitle="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
-
<Steptitle="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.
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.
0 commit comments