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
configuredValuestringThe configured identifier.
canonicalIdentifierstringThe canonical identifier when the value is accepted; otherwise an empty string.
Returns
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.