Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions authentication-personalization/authentication-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
* **Authorization URL**: Your OAuth endpoint.
* **Client ID**: Your OAuth 2.0 client identifier.
* **Client Secret**: Your OAuth 2.0 client secret.
* **Scopes**: Permissions to request. Use multiple scopes if you need different access levels.
* **Scopes**: Permissions to request. Copy the **entire** scope string (for example, for a scope like `provider.users.docs`, copy the complete `provider.users.docs`). Use multiple scopes if you need different access levels.
* **Token URL**: Your OAuth token exchange endpoint.
* **Info API URL** (optional): Endpoint to retrieve user info for personalization. If omitted, the OAuth flow will only be used to verify identity and the user info will be empty.
* **Logout URL**: The native logout URL for your OAuth provider. If your provider has a `returnTo` or similar parameter, point it back to your docs URL.
Expand All @@ -129,18 +129,18 @@
**Configure your OAuth server details** in your dashboard:
- **Authorization URL**: `https://auth.foo.com/authorization`
- **Client ID**: `ydybo4SD8PR73vzWWd6S0ObH`
- **Scopes**: `['docs-user-info']`
- **Scopes**: `['provider.users.docs']`
- **Token URL**: `https://auth.foo.com/exchange`
- **Info API URL**: `https://api.foo.com/docs/user-info`
- **Logout URL**: `https://auth.foo.com/logout?returnTo=https%3A%2F%2Ffoo.com%2Fdocs`

**Create a user info endpoint** at `api.foo.com/docs/user-info`, which requires an OAuth access token with the `docs-user-info` scope, and returns:
**Create a user info endpoint** at `api.foo.com/docs/user-info`, which requires an OAuth access token with the `provider.users.docs` scope, and returns:

```json
{
"content": {
"firstName": "Jane",

Check warning on line 142 in authentication-personalization/authentication-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/authentication-setup.mdx#L142

Did you really mean 'firstName'?
"lastName": "Doe"

Check warning on line 143 in authentication-personalization/authentication-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/authentication-setup.mdx#L143

Did you really mean 'lastName'?
},
"groups": ["engineering", "admin"]
}
Expand Down Expand Up @@ -258,7 +258,7 @@

### Page level

To make a page public, add `public: true` to the page's frontmatter.

Check warning on line 261 in authentication-personalization/authentication-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/authentication-setup.mdx#L261

Did you really mean 'frontmatter'?

```mdx Public page example
---
Expand Down
4 changes: 2 additions & 2 deletions authentication-personalization/personalization-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
icon: "user-cog"
---

Personalization customizes your documentation for each user when they are logged in. For example, you can prefill their API keys, show content specific to their plan or role, or hide sections they don't need access to.

Check warning on line 7 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L7

Did you really mean 'prefill'?

## Personalization features

Customize content with these personalization capabilities.

### API key prefilling

Check warning on line 13 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L13

Did you really mean 'prefilling'?

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.

Check warning on line 15 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L15

Did you really mean 'prefilling'?

### Dynamic MDX content

Expand All @@ -26,7 +26,7 @@

### Page visibility

Restrict which pages are visible to your users by adding `groups` fields to your pages' frontmatter. By default, every page is visible to every user.

Check warning on line 29 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L29

Did you really mean 'frontmatter'?

Users will only see pages for `groups` that they are in.

Expand Down Expand Up @@ -60,14 +60,14 @@
path="expiresAt"
type="number"
>
Session expiration time in **seconds since epoch**. If the user loads a page after this time, their stored data is automatically deleted and they must reauthenticate.

Check warning on line 63 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L63

Did you really mean 'reauthenticate'?
<Warning><b>For JWT handshakes:</b> This differs from the JWT's `exp` claim, which determines when a JWT is considered invalid. Set the JWT `exp` claim to a short duration (10 seconds or less) for security. Use `expiresAt` for the actual session length (hours to weeks).</Warning>

Check warning on line 64 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L64

Did you really mean 'expiresAt'?
</ParamField>
<ParamField
path="groups"
type="string[]"
>
List of groups the user belongs to. Pages with matching `groups` in their frontmatter are visible to this user.

Check warning on line 70 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L70

Did you really mean 'frontmatter'?

**Example**: User with `groups: ["admin", "engineering"]` can access pages tagged with either the `admin` or `engineering` groups.
</ParamField>
Expand All @@ -86,7 +86,7 @@
```mdx
Welcome back, {user.firstName}! Your {user.plan} plan includes...
```
With the example `user` data, this would render as: Welcome back, Ronan! Your Enterprise plan includes...

Check warning on line 89 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L89

Did you really mean 'Ronan'?

**Advanced conditional rendering**:
```jsx
Expand All @@ -107,7 +107,7 @@
path="apiPlaygroundInputs"
type="object"
>
User-specific values that prefill API playground fields. Saves users time by auto-populating their data when testing APIs.

Check warning on line 110 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L110

Did you really mean 'prefill'?

**Example**:
```json
Expand All @@ -117,7 +117,7 @@
"query": { "org_id": "12345" }
}
```
If a user makes requests at a specific subdomain, you can send `{ server: { subdomain: 'foo' } }` as an `apiPlaygroundInputs` field. This value will be prefilled on any API page with the `subdomain` value.

Check warning on line 120 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L120

Did you really mean 'prefilled'?

<Note>The `header`, `query`, and `cookie` fields will only prefill if they are part of your [OpenAPI security scheme](https://swagger.io/docs/specification/authentication/). If a field is in either the `Authorization` or `Server` sections, it will prefill. Creating a standard header parameter named `Authorization` will not enable this feature.</Note>
</ParamField>
Expand All @@ -126,11 +126,11 @@

```json
{
"expiresAt": 1735689600,

Check warning on line 129 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L129

Did you really mean 'expiresAt'?
"groups": ["admin", "beta-users"],
"content": {
"firstName": "Jane",

Check warning on line 132 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L132

Did you really mean 'firstName'?
"lastName": "Smith",

Check warning on line 133 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L133

Did you really mean 'lastName'?
"company": "TechCorp",
"plan": "Enterprise",
"region": "us-west"
Expand All @@ -138,7 +138,7 @@
"apiPlaygroundInputs": {
"header": {
"Authorization": "Bearer abc123",
"X-Org-ID": "techcorp"

Check warning on line 141 in authentication-personalization/personalization-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

authentication-personalization/personalization-setup.mdx#L141

Did you really mean 'techcorp'?
},
"server": {
"environment": "production",
Expand Down Expand Up @@ -244,7 +244,7 @@
3. Select **OAuth** and configure these fields:
* **Authorization URL**: Your OAuth authorization endpoint.
* **Client ID**: Your OAuth 2.0 client identifier.
* **Scopes**: Permissions to request. Must match the scopes of the endpoint that you configured in the first step.
* **Scopes**: Permissions to request. Copy the **entire** scope string (for example, for a scope like `provider.users.docs`, copy the complete `provider.users.docs`). Must match the scopes of the endpoint that you configured in the first step.
* **Token URL**: Your OAuth token exchange endpoint.
* **Info API URL**: Endpoint to retrieve user data for personalization. Created in the first step.
4. Select **Save changes**
Expand All @@ -259,7 +259,7 @@

Your documentation is hosted at `foo.com/docs` and you have an existing OAuth server that supports the PKCE flow. You want to personalize your docs based on user data.

**Create a user info endpoint** at `api.foo.com/docs/user-info`, which requires an OAuth access token with the `docs-user-info` scope and responds with the user's custom data:
**Create a user info endpoint** at `api.foo.com/docs/user-info`, which requires an OAuth access token with the `provider.users.docs` scope and responds with the user's custom data:

```json
{
Expand Down