Table of Contents

Method TryCanonicalize

Namespace
MailFathom.Common.OAuth
Assembly
MailFathom.Common.dll

TryCanonicalize(string?, out string)

Brings a configured identifier to the one form everything else compares against.

public static bool TryCanonicalize(string? configuredValue, out string canonicalIdentifier)

Parameters

configuredValue string

The configured identifier.

canonicalIdentifier string

The canonical identifier when the value is accepted; otherwise an empty string.

Returns

bool

true when the value is usable as an OAuth identifier; otherwise false.

Remarks

The scheme and host are lowercased and a default port is dropped, because neither carries meaning in a URL and the MCP authorization specification asks an implementation to accept an uppercase scheme or host for robustness. A trailing slash is dropped where the path is empty, which is the form that specification asks implementations to settle on; on a path that identifies something, a trailing slash is part of what it identifies and is left alone. Use this for a value MailFathom itself publishes, never for one an authorization server emits.