configureProtectedResource method

void configureProtectedResource({
  1. required String resource,
  2. required List<String> authorizationServers,
  3. List<String>? scopesSupported,
  4. List<String>? bearerMethodsSupported,
  5. String? resourceDocumentation,
})

Configure the OAuth Protected Resource metadata served at /.well-known/oauth-protected-resource (RFC 9728).

Implementation

void configureProtectedResource({
  required String resource,
  required List<String> authorizationServers,
  List<String>? scopesSupported,
  List<String>? bearerMethodsSupported,
  String? resourceDocumentation,
}) {
  _protectedResource = _ProtectedResourceMetadata(
    resource: resource,
    authorizationServers: List.unmodifiable(authorizationServers),
    scopesSupported: scopesSupported == null
        ? null
        : List.unmodifiable(scopesSupported),
    bearerMethodsSupported: bearerMethodsSupported == null
        ? null
        : List.unmodifiable(bearerMethodsSupported),
    resourceDocumentation: resourceDocumentation,
  );
}