Skip to content

Commit 6004a20

Browse files
committed
refactor: add use case catelogs
1 parent b841778 commit 6004a20

22 files changed

+323
-131
lines changed

docs/quick-starts/third-party/oidc/README.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar_custom_props:
66
logoFilename: 'oidc.svg'
77
---
88

9+
import QuickStartsReference from './_quick-starts-reference.md';
10+
911
# Integrate third-party app with OIDC / OAuth
1012

1113
Use Logto as your identity provider (IdP) to integrate third-party apps via OpenID Connect (OIDC) or OAuth 2.0 protocol.
@@ -35,9 +37,12 @@ In order to set up Logto as an IdP for your third-party applications, you need t
3537
3. Retrieve the **authorization endpoint** and **token endpoint** from Logto application details page and provide them to your service provider.
3638

3739
- If your service provider supports OIDC discovery, you can simply copy the **discovery endpoint** from Logto application details page and provide it to your service provider. The service provider will be able to retrieve all the up to date OIDC authentication information from the discovery endpoint automatically.
38-
3940
- Otherwise, click on the **Show endpoint details** button to view all the OIDC authentication endpoints.
4041

42+
---
43+
44+
<QuickStartsReference />
45+
4146
## Manage your third-party applications \{#manage-your-third-party-applications}
4247

4348
All third-party applications will be catalogued on the **Applications** page, specifically under the **Third-party apps** tab. This arrangement distinguishes them from first-party applications for you, ensuring easy management.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Under the hood, a third-party app is just a standard OAuth 2.0 / OIDC client. This means you (or the third-party developer) can use any OAuth 2.0 / OIDC library or framework to integrate with Logto.
2+
3+
If you're not familiar with OAuth 2.0 or OIDC, you can start by following one of our “Traditional web” quick start guides.
4+
5+
A few things to keep in mind:
6+
7+
1. Logto currently requires third-party apps to be “Traditional web” apps. In other words, the app needs a backend server (or backend-for-frontend) to securely store the client secret.
8+
2. Most our quick start guides are written for first-party apps, but you can still use them as a reference for third-party app integration.
9+
3. The main difference is that third-party apps will show a consent screen, asking users for explicit permission to access their data.
10+
11+
You can find more information in our [quick start guides](https://docs.logto.io/quick-starts).

docs/use-cases/README.md

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

docs/use-cases/README.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
sidebar_position: 1
3+
sidebar_label: Introduction
4+
---
5+
6+
import AiCatalog from './ai/fragments/_catalog.mdx';
7+
import AuthorizationCatalog from './authorization/fragments/_catalog.mdx';
8+
import MultiTenancyCatalog from './multi-tenancy/fragments/_catalog.mdx';
9+
10+
# Logto use cases
11+
12+
Logto is a powerful auth infrastructure and identity and access management (IAM) solution that can be used in various scenarios. We have created a series of use cases to help you understand how to leverage Logto in different contexts.
13+
14+
## Authorization
15+
16+
<AuthorizationCatalog headingLevel={3} />
17+
18+
## Multi-tenancy
19+
20+
<MultiTenancyCatalog headingLevel={3} />
21+
22+
## AI
23+
24+
<AiCatalog headingLevel={3} />

docs/use-cases/ai/README.mdx

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,11 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 3
33
sidebar_label: AI use cases
44
description: Explore how Logto can help you build secure, AI-enabled experiences.
55
---
66

7-
import AuthorizationIcon from '@site/src/assets/authorization.svg';
7+
import Catalog from './fragments/_catalog.mdx';
88

99
# AI integration use cases with Logto
1010

11-
Explore how Logto empowers you to build secure, AI-enabled experiences. Whether you’re implementing the Model Context Protocol (MCP) or integrating AI agents into your app, Logto offers developer-friendly authentication and authorization solutions.
12-
13-
## Build your MCP server
14-
15-
<DocCardList
16-
items={[
17-
{
18-
type: 'link',
19-
label: 'Enable auth for your MCP-powered apps',
20-
href: '/use-cases/ai/mcp-server-add-auth',
21-
description:
22-
'Learn how to integrate authentication and authorization into your MCP server, allowing secure access for your own apps and services.',
23-
customProps: {
24-
icon: <AuthorizationIcon />,
25-
},
26-
},
27-
{
28-
type: 'link',
29-
label: 'Enable AI agent and third-party app access to your MCP server',
30-
href: '/use-cases/ai/mcp-server-enable-ai-agent-and-third-party-access',
31-
description:
32-
'Find out how to enable authentication and authorization for AI agents and third-party apps connecting to your MCP server.',
33-
customProps: {
34-
icon: <AuthorizationIcon />,
35-
},
36-
},
37-
]}
38-
/>
39-
40-
## AI-ready auth for your app
41-
42-
<DocCardList
43-
items={[
44-
{
45-
type: 'link',
46-
label: 'Enable AI agent access to your app',
47-
href: '/use-cases/ai/enable-ai-agent-access',
48-
description:
49-
'Discover how to add authentication and authorization for AI agents accessing your app, ensuring security and control across AI-driven workflows.',
50-
customProps: {
51-
icon: <AuthorizationIcon />,
52-
},
53-
},
54-
]}
55-
/>
11+
<Catalog />

docs/use-cases/ai/enable-ai-agent-access.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,26 @@ sidebar_label: Enable AI agent access to app
44
---
55

66
# Enable AI agent access to your app
7+
8+
:::caution
9+
👷 This tutorial is still in progress. Please check back later for updates. 🚧
10+
:::
11+
12+
This guide walks you through integrating Logto with your service and enabling AI agents to access it.
13+
14+
You'll learn how to:
15+
16+
- Configure Logto as the authorization server for your service.
17+
- Obtain an access token for the AI agent to access your service.
18+
- Test the flow with an AI agent.
19+
20+
## Prerequisites
21+
22+
- A [Logto Cloud](https://cloud.logto.io) (or self-hosted) tenant
23+
- A service that exposes API endpoints to be accessed by the AI agent
24+
25+
### Understanding the flow
26+
27+
- **Service**: The service you want to expose to the AI agent.
28+
- **AI agent**: The AI agent that will access your service.
29+
- **Logto**: Serves as the OpenID Connect provider (authorization server) and manages user identities.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import FlaskIcon from '@site/src/assets/flask.svg';
2+
import RobotIcon from '@site/src/assets/robot.svg';
3+
import SecurityIcon from '@site/src/assets/security.svg';
4+
import DynamicHeading from '@site/src/components/DynamicHeading';
5+
6+
Explore how Logto empowers you to build secure, AI-enabled experiences. Whether you’re implementing the Model Context Protocol (MCP) or integrating AI agents into your app, Logto offers developer-friendly authentication and authorization solutions.
7+
8+
<DynamicHeading level={props.headingLevel ?? 2}>Build your MCP server</DynamicHeading>
9+
10+
<DocCardList
11+
items={[
12+
{
13+
type: 'link',
14+
label: 'Enable auth for your MCP-powered apps',
15+
href: '/use-cases/ai/mcp-server-add-auth',
16+
description:
17+
'Learn how to integrate authentication and authorization into your MCP server, allowing secure access for your own apps and services.',
18+
customProps: {
19+
icon: <SecurityIcon />,
20+
},
21+
},
22+
{
23+
type: 'link',
24+
label: 'Enable AI agent and third-party app access to your MCP server',
25+
href: '/use-cases/ai/mcp-server-enable-ai-agent-and-third-party-access',
26+
description:
27+
'Find out how to enable authentication and authorization for AI agents and third-party apps connecting to your MCP server.',
28+
customProps: {
29+
icon: <FlaskIcon />,
30+
},
31+
},
32+
]}
33+
/>
34+
35+
<DynamicHeading level={props.headingLevel ?? 2}>AI-ready auth for your app</DynamicHeading>
36+
37+
<DocCardList
38+
items={[
39+
{
40+
type: 'link',
41+
label: 'Enable AI agent access to your app',
42+
href: '/use-cases/ai/enable-ai-agent-access',
43+
description:
44+
'Discover how to add authentication and authorization for AI agents accessing your app, ensuring security and control across AI-driven workflows.',
45+
customProps: {
46+
icon: <RobotIcon />,
47+
},
48+
},
49+
]}
50+
/>

docs/use-cases/ai/fragments/_mcp-introduction.mdx

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

docs/use-cases/ai/fragments/_mcp-prerequisites.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
### Understanding the architecture
77

88
- **MCP server**: The server that exposes tools and resources to MCP clients.
9-
- **MCP Inspector**: A MCP client used to initiate the authentication flow and test the integration.
9+
- **MCP client**: A client used to initiate the authentication flow and test the integration. {props.clientDescription && <b>{props.clientDescription}</b>}
1010
- **Logto**: Serves as the OpenID Connect provider (authorization server) and manages user identities.
1111

1212
A non-normative sequence diagram illustrates the overall flow of the process:
1313

1414
```mermaid
1515
sequenceDiagram
16-
participant Client as MCP Inspector
16+
participant Client as Client
1717
participant Server as MCP Server
1818
participant Logto
1919

docs/use-cases/ai/fragments/_mcp-sample-code.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import Tabs from '@theme/Tabs';
44
<Tabs groupId="sdk">
55
<TabItem value="python" label="Python">
66

7-
The full code can be found in the [mcp-auth/python](https://github.com/mcp-auth/python) repository.
7+
The full MCP server code can be found in the [mcp-auth/python](https://github.com/mcp-auth/python) repository.
88

99
</TabItem>
1010
<TabItem value="node" label="Node.js">
1111

12-
The full code can be found in the [mcp-auth/js](https://github.com/mcp-auth/js) repository.
12+
The full MCP server code can be found in the [mcp-auth/js](https://github.com/mcp-auth/js) repository.
1313

1414
</TabItem>
1515
</Tabs>

docs/use-cases/ai/fragments/_mcp-test-integration.mdx

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

docs/use-cases/ai/mcp-server-add-auth.mdx

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@ sidebar_position: 1
33
sidebar_label: Enable auth for MCP-powered apps
44
---
55

6-
import Introduction from './fragments/_mcp-introduction.mdx';
76
import Prerequisites from './fragments/_mcp-prerequisites.mdx';
87
import SampleCode from './fragments/_mcp-sample-code.mdx';
98
import SetUpServer from './fragments/_mcp-set-up-server.mdx';
10-
import TestIntegration from './fragments/_mcp-test-integration.mdx';
119

1210
# Enable auth for your MCP-powered apps with Logto
1311

14-
<Introduction />
12+
This guide walks you through integrating Logto with your MCP server using [mcp-auth](https://mcp-auth.dev), allowing you to authenticate users and securely retrieve their identity information using the standard OpenID Connect flow.
1513

16-
<Prerequisites />
14+
You'll learn how to:
15+
16+
- Configure Logto as the authorization server for your MCP server.
17+
- Set up a “whoami” tool to return the current user's identity claims.
18+
- Test the flow with the MCP Inspector.
19+
20+
After this tutorial, your MCP server will:
21+
22+
- Authenticate users in your Logto tenant.
23+
- Return identity claims (`sub`, `username`, `name`, `email`, etc.) for the "whoami" tool invocation.
24+
25+
Once the integration is complete, you can replace the MCP Inspector with your own MCP client, such as a web app, to access the tools and resources exposed by your MCP server.
26+
27+
<Prerequisites clientDescription="We'll use the MCP Inspector as the client in this guide." />
1728

1829
## Set up app in Logto
1930

@@ -25,6 +36,44 @@ import TestIntegration from './fragments/_mcp-test-integration.mdx';
2536

2637
<SetUpServer />
2738

28-
<TestIntegration />
39+
## Test the integration
40+
41+
1. Start the MCP server
42+
2. Start the MCP Inspector.
43+
44+
Due to the limit of the current MCP Inspector implementation, we need to use the forked version from mcp-auth:
45+
46+
```bash
47+
git clone https://github.com/mcp-auth/inspector.git
48+
cd inspector
49+
npm install
50+
npm run dev
51+
```
52+
53+
Then, open the URL shown in the terminal.
54+
55+
3. In the MCP Inspector:
56+
57+
- **Transport Type**: `SSE`
58+
- **URL**: `http://localhost:3001/sse`
59+
- **OAuth Client ID**: Paste your Logto App ID
60+
- **Auth Params**: `{"scope": "openid profile email"}`
61+
- **Redirect URI**: This URL should be auto-populated. Copy it.
62+
63+
4. Find the application you created earlier in the Logto Console, open the details page, and paste the redirect URI into the **Settings** / **Redirect URIs** section. Save the changes.
64+
5. Back in the MCP Inspector, click **Connect**. This should redirect you to the Logto sign-in experience.
65+
66+
After completing sign-in, you should be redirected back to the MCP Inspector. Go to **Tools** -> **List Tools** -> **whoami** -> **Run Tool**.
67+
68+
You should see user claims, such as:
69+
70+
```json
71+
{
72+
"sub": "user_XXXX",
73+
"username": "alice",
74+
"name": "Alice Smith",
75+
"email": "alice@example.com"
76+
}
77+
```
2978

3079
<SampleCode />

0 commit comments

Comments
 (0)