Skip to content

Commit d1fb5a7

Browse files
committed
Combine information into overview
1 parent e4b7f52 commit d1fb5a7

File tree

3 files changed

+155
-40
lines changed

3 files changed

+155
-40
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: "Overview"
3+
description: "Control who sees your documentation and customize their experience"
4+
icon: "badge-info"
5+
---
6+
<Info>
7+
Authentication methods are available on the [Growth and Enterprise plans](https://mintlify.com/pricing?ref=authentication). Please{" "}
8+
<a href="mailto:[email protected]">contact sales</a> for more information.
9+
</Info>
10+
11+
There are three approaches to manage access and customize your documentation based on user information.
12+
13+
* **Authentication**: Complete privacy protection for all content with full content customization.
14+
* **Partial authentication**: Page-by-page access control with full content customization.
15+
* **Personalization**: Content customization with **no security guarantees**. All content remains publicly accessible.
16+
17+
**Choose authentication** if you need complete security and privacy for all your documentation, including pages, images, search results, and AI assistant features.
18+
19+
**Choose partial authentication** if you want some pages to be public and others private.
20+
21+
**Choose personalization** if you want to customize content based on user information and your documentation can be publicly accessible.
22+
23+
## Handshake methods
24+
25+
Authentication and personalization offer multiple handshake methods for controlling access to your content.
26+
27+
### Available for all methods
28+
29+
**JSON Web Token (JWT)**: Custom system where you manage user tokens with full control over the login flow.
30+
* Pros of JWT:
31+
* Reduced risk of API endpoint abuse.
32+
* No CORS configuration.
33+
* No restrictions on API URLs.
34+
* Cons of JWT:
35+
* Must be compatible with your existing login flow.
36+
* Dashboard sessions and docs authentication are decoupled, so your team will log in to your dashboard and your docs separately.
37+
* When you refresh user data, users must login to your docs again. If your users' data changes frequently, they must log in frequently or risk having stale data in your docs.
38+
39+
**OAuth 2.0**: Third-party login integration like Google, GitHub, or other OAuth providers.
40+
* Pros of OAuth 2.0:
41+
* Heightened security standard.
42+
* No restrictions on API URLs.
43+
* Cons of OAuth 2.0:
44+
* Requires significant work if setting up an OAuth server for the first time.
45+
* Dashboard sessions and docs authentication are decoupled, so your team will log in to your dashboard and your docs separately.
46+
47+
### Available for authentication and partial authentication
48+
49+
**Mintlify dashboard**: Allow all of your dashboard users to access your docs.
50+
* Pros of Mintlify dashboard:
51+
* No configuration required.
52+
* Cons of Mintlify dashboard:
53+
* Requires all users of your docs to have an account in your Mintlify dashboard.
54+
55+
**Password**: Shared access with a single global password. Used for access control only. Does not allow for personalization.
56+
* Pros of password:
57+
* Simple setup with no configuration required to add new users, just share the password.
58+
* Cons of password:
59+
* Lose personalization features since there is no way to differentiate users with the same password.
60+
* Must change the password to revoke access.
61+
62+
### Available for personalization
63+
64+
**Shared session**: Use the same session token as your dashboard to personalize content.
65+
* Pros of shared session:
66+
* Users that are logged into your dashboard are automatically logged into your docs.
67+
* User sessions are persistent so you can refresh data without requiring a new login.
68+
* Minimal setup.
69+
* Cons of shared session:
70+
* Your docs will make a request to your backend.
71+
* You must have a dashboard that uses session authentication.
72+
* CORS configuration is generally required.
73+
74+
## Content customization
75+
76+
All three methods allow you to customize content with these personalization features.
77+
78+
### Dynamic content
79+
80+
Display dynamic content based on user information like name, plan, or organization.
81+
82+
The `user` variable contains information sent to your docs from logged in users.
83+
84+
**Example**: Hello, {user.name ?? 'reader'}!
85+
86+
```jsx
87+
Hello, {user.name ?? 'reader'}!
88+
```
89+
90+
This feature is more powerful when you pair it with custom data about your users. For example, you can give different instructions based on a user's plan.
91+
92+
**Example**: Authentication is an enterprise feature. {
93+
user.org === undefined
94+
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
95+
: user.org.plan !== 'enterprise'
96+
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
97+
: <>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
98+
}
99+
100+
```jsx
101+
Authentication is an enterprise feature. {
102+
user.org === undefined
103+
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
104+
: user.org.plan !== 'enterprise'
105+
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
106+
: <>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
107+
}
108+
```
109+
110+
<Note>
111+
The information in `user` is only available for logged in users. For
112+
logged out users, the value of `user` will be `{}`. To prevent the page from
113+
crashing for logged out users, always use optional chaining on your `user`
114+
fields. For example, `{user.org?.plan}`.
115+
</Note>
116+
117+
### API key prefilling
118+
119+
Automatically populate API playground fields with user-specific values by returning matching field names in your user data. The field names in your user data must exactly match the names in the API playground for automatic prefilling to work.
120+
121+
### Page visibility
122+
123+
Restrict which pages are visible to your users by adding `groups` fields to your pages' frontmatter.
124+
125+
Users will only see pages for `groups` that they are in.
126+
127+
```md
128+
---
129+
title: "Managing your users"
130+
description: "Adding and removing users from your organization"
131+
groups: ["admin"]
132+
---
133+
```

docs.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
{
101101
"group": "Authentication and Personalization",
102102
"pages": [
103-
"settings/authentication-personalization/comparison",
103+
"authentication-personalization/overview",
104104
"settings/authentication-personalization/authentication",
105105
"settings/authentication-personalization/partial-authentication",
106106
"settings/authentication-personalization/personalization",
@@ -382,7 +382,27 @@
382382
"redirects": [
383383
{
384384
"source": "settings/authentication-personalization/authentication-vs-personalization",
385-
"destination": "settings/authentication-personalization/comparison"
385+
"destination": "authentication-personalization/overview"
386+
},
387+
{
388+
"source": "settings/authentication-personalization/authentication-setup/choosing-a-handshake",
389+
"destination": "authentication-personalization/overview"
390+
},
391+
{
392+
"source": "settings/authentication-personalization/personalization-setup/choosing-a-handshake",
393+
"destination": "authentication-personalization/overview"
394+
},
395+
{
396+
"source": "settings/authentication-personalization/authentication",
397+
"destination": "authentication-personalization/authentication-setup"
398+
},
399+
{
400+
"source": "settings/authentication-personalization/personalization",
401+
"destination": "authentication-personalization/personalization-setup"
402+
},
403+
{
404+
"source": "settings/authentication-personalization/partial-authentication",
405+
"destination": "authentication-personalization/partial-authentication-setup"
386406
}
387407
]
388408
}

settings/authentication-personalization/comparison.mdx

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)