Skip to content

Commit 2a1cbd8

Browse files
add client crendentials grant type
1 parent 7251679 commit 2a1cbd8

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

docs/specification/2025-03-26/basic/authorization.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,28 @@ while maintaining simplicity:
5050
Server Metadata ([RFC8414](https://datatracker.ietf.org/doc/html/rfc8414)). Servers
5151
that do not support Authorization Server Metadata **MUST** follow the default URI
5252
schema.
53+
54+
OAuth specifies different flows or grant types, which in essence, are different ways of obtaining an access token.
55+
Each of these targets different use cases and scenarios.
5356

54-
### 2.2 Basic OAuth 2.1 Authorization
57+
This specification focuses on two authorization scenarios:
58+
59+
1. User to system: The client is operated by the end user (a human), allowing the client to operate on the user's behalf.
60+
2. System to system: The client is another application (LLM or not)
61+
62+
**NOTE**: For simplicity purposes, the following examples will assume the MCP server to also function as the authorization server. However,
63+
in a real implementation the authorization server will probably be deployed as its own distinct service.
64+
65+
### 2.2 OAuth 2.1 User to System through the Authorization Code Grant Type
66+
67+
A human user completes the OAuth flow through a web browser, obtaining an access token that identifies them personally and allows the
68+
client to act on their behalf.
5569

5670
When authorization is required and not yet proven by the client, servers **MUST** respond
5771
with _HTTP 401 Unauthorized_.
5872

5973
Clients initiate the
60-
[OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12)
74+
[OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#name-authorization-code-grant)
6175
authorization flow after receiving the _HTTP 401 Unauthorized_.
6276

6377
The following demonstrates the basic OAuth 2.1 for public clients using PKCE.
@@ -81,8 +95,32 @@ sequenceDiagram
8195
C->>M: MCP Request with Access Token
8296
Note over C,M: Begin standard MCP message exchange
8397
```
98+
### 2.3 OAuth 2.1 System to System through the Client Credentials Grant Type
99+
100+
In this case, the client acts not in behalf of a human user but a system. Therefore, the access token is obtained by only sharing the client
101+
credentials and doesn't require browser interaction.
102+
103+
When authorization is required and not yet proven by the client, servers **MUST** respond
104+
with _HTTP 401 Unauthorized_.
105+
106+
Clients initiate the
107+
[OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#name-client-credentials-grant)
108+
Client Credentials flow after receiving the _HTTP 401 Unauthorized_.
109+
110+
```mermaid
111+
sequenceDiagram
112+
participant C as Client
113+
participant M as MCP Server
114+
115+
C->>M: MCP Request
116+
M->>C: HTTP 401 Unauthorized
117+
C->>M: Token Request with client_id + client_secret
118+
M->>C: Access Token (+ Refresh Token)
119+
C->>M: MCP Request with Access Token
120+
Note over C,M: Begin standard MCP message exchange
121+
```
84122

85-
### 2.3 Server Metadata Discovery
123+
### 2.4 Server Metadata Discovery
86124

87125
For server capability discovery:
88126

0 commit comments

Comments
 (0)