@@ -128,38 +128,54 @@ export const OAuthFlowProgress = ({
128
128
label = "Metadata Discovery"
129
129
{ ...getStepProps ( "metadata_discovery" ) }
130
130
>
131
- { authState . resourceMetadata && (
132
- < details className = "text-xs mt-2" >
133
- < summary className = "cursor-pointer text-muted-foreground font-medium" >
134
- Retrieved OAuth Resource Metadata from { ( new URL ( '/.well-known/oauth-protected-resource' , serverUrl ) ) . href }
135
- </ summary >
136
- < pre className = "mt-2 p-2 bg-muted rounded-md overflow-auto max-h-[300px]" >
137
- { JSON . stringify ( authState . resourceMetadata , null , 2 ) }
138
- </ pre >
139
- </ details >
140
- ) }
141
- { authState . resourceMetadataError && (
142
- < div className = "mt-2 p-3 border border-yellow-300 bg-yellow-50 rounded-md" >
143
- < p className = "text-sm font-small text-yellow-700" >
144
- Failed to retrieve resource metadata, falling back to /.well-known/oauth-authorization-server:
145
- </ p >
146
- < p className = "text-xs text-yellow-600 mt-1" >
147
- { authState . resourceMetadataError . message }
148
- { authState . resourceMetadataError instanceof TypeError
149
- ? " (This could indicate the endpoint doesn't exist or does not have CORS configured)"
150
- : authState . resourceMetadataError [ 'status' ] && ` (${ authState . resourceMetadataError [ 'status' ] } )` }
151
- </ p >
152
- </ div >
153
- ) }
154
131
{ provider . getServerMetadata ( ) && (
155
132
< details className = "text-xs mt-2" >
156
133
< summary className = "cursor-pointer text-muted-foreground font-medium" >
157
- Retrieved OAuth Metadata from { serverUrl }
158
- /.well-known/oauth-authorization-server
134
+ OAuth Metadata Sources
135
+ { ! authState . resourceMetadata && " ℹ️" }
159
136
</ summary >
160
- < pre className = "mt-2 p-2 bg-muted rounded-md overflow-auto max-h-[300px]" >
161
- { JSON . stringify ( provider . getServerMetadata ( ) , null , 2 ) }
162
- </ pre >
137
+
138
+ { authState . resourceMetadata && (
139
+ < div className = "mt-2" >
140
+ < p className = "font-medium" > Resource Metadata:</ p >
141
+ < p className = "text-xs text-muted-foreground" >
142
+ From { new URL ( '/.well-known/oauth-protected-resource' , serverUrl ) . href }
143
+ </ p >
144
+ < pre className = "mt-2 p-2 bg-muted rounded-md overflow-auto max-h-[300px]" >
145
+ { JSON . stringify ( authState . resourceMetadata , null , 2 ) }
146
+ </ pre >
147
+ </ div >
148
+ ) }
149
+
150
+ { authState . resourceMetadataError && (
151
+ < div className = "mt-2 p-3 border border-blue-300 bg-blue-50 rounded-md" >
152
+ < p className = "text-sm font-medium text-blue-700" >
153
+ ℹ️ No resource metadata available from { ' ' }
154
+ < a href = { new URL ( '/.well-known/oauth-protected-resource' , serverUrl ) . href } target = "_blank" rel = "noopener noreferrer" className = "text-blue-500 hover:text-blue-700" >
155
+ { new URL ( '/.well-known/oauth-protected-resource' , serverUrl ) . href }
156
+ </ a >
157
+ </ p >
158
+ < p className = "text-xs text-blue-600 mt-1" >
159
+ Resource metadata was added in the < a href = "https://modelcontextprotocol.io/specification/draft/basic/authorization#2-3-1-authorization-server-location" > 2025-DRAFT-v2 specification update</ a >
160
+ < br />
161
+ { authState . resourceMetadataError . message }
162
+ { authState . resourceMetadataError instanceof TypeError
163
+ && " (This could indicate the endpoint doesn't exist or does not have CORS configured)" }
164
+ </ p >
165
+ </ div >
166
+ ) }
167
+
168
+ { provider . getServerMetadata ( ) && (
169
+ < div className = "mt-2" >
170
+ < p className = "font-medium" > Authorization Server Metadata:</ p >
171
+ { authState . authServerUrl && < p className = "text-xs text-muted-foreground" >
172
+ From { new URL ( '/.well-known/oauth-authorization-server' , authState . authServerUrl ) . href }
173
+ </ p > }
174
+ < pre className = "mt-2 p-2 bg-muted rounded-md overflow-auto max-h-[300px]" >
175
+ { JSON . stringify ( provider . getServerMetadata ( ) , null , 2 ) }
176
+ </ pre >
177
+ </ div >
178
+ ) }
163
179
</ details >
164
180
) }
165
181
</ OAuthStepDetails >
0 commit comments