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
Copy file name to clipboardExpand all lines: exercises/02.init/02.problem.params/README.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Auth Params
2
2
3
-
👨💼 In EpicMe, when a user tries to access a protected journal entry, it's not enough to simply block them. We need to let them know why. If a request is missing the right credentials, the server should respond with a `WWW-Authenticate` header that includes extra details, called auth params, so the client understands what went wrong and how to fix it.
3
+
👨💼 In EpicMe, when a user tries to access a protected journal entry, it's not enough to simply block them. We need to let them what to do about it. If a request is missing the right credentials, the server should respond with a `WWW-Authenticate` header that includes extra details, called auth params, so the client understands what went wrong and how to fix it.
4
4
5
5
For example, if a robot tries to fetch `/api/lemonade` without the right credentials, the response should include a realm and a resource_metadata parameter:
MCPClient->>MCPServer: GET https://api.example.com/metadata
49
+
MCPServer->>MCPClient: Resource metadata response
50
+
```
51
+
39
52
## About the WWW-Authenticate Header
40
53
41
54
The `WWW-Authenticate` header tells the client what authentication scheme is required and can include additional parameters (called "auth params") that provide more details about how to authenticate.
@@ -46,15 +59,16 @@ The simplest value is just the scheme:
46
59
WWW-Authenticate: Bearer
47
60
```
48
61
49
-
But you can also include auth params, such as `realm`, `error`, or `error_description`:
62
+
But you can also include auth params, such as `realm`, `error`, `error_description`, or `resource_metadata`:
-**realm**: A string identifying the protected area (useful for clients to display to users)
56
69
-**error**: A short error code (like `invalid_token` or `insufficient_scope`)
57
70
-**error_description**: A human-readable explanation of the error
71
+
-**resource_metadata**: A URL pointing to metadata about the resource server (helps clients understand what they're accessing)
58
72
59
73
These parameters help clients understand why authentication failed and what to do next. You can include as many or as few as make sense for your use case.
0 commit comments