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
For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is the project's unqiue subdomain. Click on `Use: [SUBDOMAIN].mintlify.dev`
18
+
For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is the project's unique subdomain. Click on `Use: [SUBDOMAIN].mintlify.dev`
Copy file name to clipboardExpand all lines: advanced/user-auth/jwt.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ If you don’t have a dashboard, or if you want to keep your dashboard and docs
16
16
- Authenticate the user
17
17
- Create a JWT containing the authenticated user's info in the [UserInfo](./sending-data) format
18
18
- Sign the JWT with the secret
19
-
- Create a redirect URL back to your docs, including the JWT as a query parameter with the name `user_auth`
19
+
- Create a redirect URL back to your docs, including the JWT as the hash
20
20
</Step>
21
21
<Steptitle="Configure your User Auth settings">
22
22
Return to your [Mintlify dashboard settings](https://dashboard.mintlify.com/settings/integrations) and add the login URL to your User Auth settings.
@@ -27,6 +27,6 @@ If you don’t have a dashboard, or if you want to keep your dashboard and docs
27
27
28
28
I want to set up authentication for my docs hosted at `docs.foo.com`. I want my docs to be completely separate from my dashboard (or I don’t have a dashboard at all).
29
29
30
-
To set up authentication with Mintlify, I go to my Mintlify dashboard and generate a JWT secret. I create a web URL `https://foo.com/docs-login` that initiates a login flow for my users. At the end of this login flow, once I have verified the identity of the user, I create a JWT containing the user’s custom data according to Mintlify’s specification. I sign this JWT with my Mintlify secret, create a redirect URL of the form `https://docs.foo.com?user_auth={SIGNED_JWT}`, and redirect the user.
30
+
To set up authentication with Mintlify, I go to my Mintlify dashboard and generate a JWT secret. I create a web URL `https://foo.com/docs-login` that initiates a login flow for my users. At the end of this login flow, once I have verified the identity of the user, I create a JWT containing the user’s custom data according to Mintlify’s specification. I sign this JWT with my Mintlify secret, create a redirect URL of the form `https://docs.foo.com#{SIGNED_JWT}`, and redirect the user.
31
31
32
32
I then go to the Mintlify dashboard settings and enter `https://foo.com/docs-login` for the Login URL field.
Copy file name to clipboardExpand all lines: advanced/user-auth/overview.mdx
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'Overview'
2
+
title: 'Introduction'
3
3
description: 'Give your users a personalized docs experience'
4
4
---
5
5
@@ -13,7 +13,7 @@ User Auth allows you to configure a method for identifying and authenticating yo
13
13
14
14
1.**Customize MDX content** with a user's information, such as their name, plan, or title.
15
15
2.**Prefill API keys** in the API Playground for streamlined use.
16
-
3.<bclassName="text-primary">(Coming soon!)</b> **Selectively show pages** in the navigation based on a user's groups.
16
+
3.**Selectively show pages** in the navigation based on a user's groups.
17
17
18
18
## What *isn't* User Auth
19
19
@@ -22,29 +22,37 @@ At this time, User Auth cannot provide any of the following:
22
22
1.**Private docs content.** While you can hide pages from unauthenticated users, those pages are still accessible by anyone who can guess the URL. If your documentation contains sensitive information, User Auth is not enough to hide it.
23
23
2.**A Mintlify-backed user database.** Mintlify does not store *any* information about your users. Rather, it relies on your existing infrastructure to serve as the source-of-truth for user data.
24
24
25
-
<Note>If you are interested in private docs content, [contact our team]([email protected]) to explore solutions.</Note>
25
+
<Note>If you are interested in private docs content, [contact our team](mailto:[email protected]) to explore solutions.</Note>
26
26
27
27
## How to Use
28
28
29
29
### Customizing MDX Content
30
30
31
-
When writing content, you can use the `userContext` variable to access the information you have sent to your docs. Here's a real world example:
31
+
When writing content, you can use the `userContext` variable to access the information you have sent to your docs. Here's a simple example:
32
+
33
+
Hello, {userContext.name??'reader'}!
34
+
35
+
```jsx
36
+
Hello, {userContext.name??'reader'}!
37
+
```
38
+
39
+
This feature becomes even more powerful when paired with custom data about the user. Here's a real world example that allows us to give specific instructions on how to access the User Auth feature based on the customer's existing plan:
32
40
33
41
User Auth is an enterprise feature. {
34
42
userContext.org === undefined
35
43
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
36
44
: userContext.org.plan !== 'enterprise'
37
-
? <>You are currently on the ${userContext.org.plan??'free'} plan. To upgrade, navigate to the <ahref="https://dashboard.mintlify.com/settings/billing">billing page</a> in the Mintlify dashboard.</>
38
-
: <>As an enterprise organization, you can enable this feature right now from your <ahref="https://dashboard.mintlify.com/settings/integrations">Mintlify dashboard settings</a></>
45
+
? <>You are currently on the ${userContext.org.plan??'free'} plan. Tospeak to our team about upgrading, <a href="mailto:sales@mintlify.com">contact our sales team</a>.</>
46
+
:<>To request this feature for your enterprise org,<a href="mailto:sales@mintlify.com">contact our team</a>.</>
39
47
}
40
48
41
49
```jsx
42
50
User Auth is an enterprise feature. {
43
51
userContext.org === undefined
44
52
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
45
53
: userContext.org.plan !== 'enterprise'
46
-
?<>You are currently on the ${userContext.org.plan??'free'} plan. Toupgrade, navigate to the <a href="https://dashboard.mintlify.com/settings/billing">billing page</a>in the Mintlify dashboard.</>
47
-
:<>As an enterprise organization, you can enable this feature right now from your<a href="https://dashboard.mintlify.com/settings/integrations">Mintlify dashboard settings</a></>
54
+
? <>You are currently on the ${userContext.org.plan??'free'} plan. Tospeak to our team about upgrading, <a href="mailto:sales@mintlify.com">contact our sales team</a>.</>
55
+
:<>To request this feature for your enterprise org,<a href="mailto:sales@mintlify.com">contact our team</a>.</>
48
56
}
49
57
```
50
58
@@ -55,7 +63,6 @@ User Auth is an enterprise feature. {
55
63
### Prefilling API Keys
56
64
57
65
If you return API Playground inputs in the user info, they will automatically be prefilled in the API Playground. Make sure the name of the field in the user info is an exact match of the name in the API Playground.
58
-
{/*
59
66
### Showing/Hiding Pages
60
67
61
68
By default, every page is visible to every user. If you want to restrict which pages are visible to your users, you can add a `groups` field in your page metadata.
0 commit comments