wellKnownProtectedResourceUrl method

Uri wellKnownProtectedResourceUrl(
  1. String resourceUrl
)

Derive the RFC 9728 well-known PRM URL for a resource origin, used as the fallback when a 401 carries no resource_metadata= param (SEP-985).

https://api.example.com/mcphttps://api.example.com/.well-known/ oauth-protected-resource. The well-known segment is inserted at the origin per RFC 9728 §3.1.

Implementation

Uri wellKnownProtectedResourceUrl(String resourceUrl) {
  final uri = Uri.parse(resourceUrl);
  return Uri.parse(
      '${uri.origin}/.well-known/oauth-protected-resource');
}