Skip to content

Read spidL from SAMLRequest Authentication Extensions (highest priority) - #94

Open
mtagliaferri86 with Copilot wants to merge 2 commits into
mainfrom
copilot/read-spidl-from-samlrequest-extensions
Open

Read spidL from SAMLRequest Authentication Extensions (highest priority)#94
mtagliaferri86 with Copilot wants to merge 2 commits into
mainfrom
copilot/read-spidl-from-samlrequest-extensions

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

spidL was only extracted from referer, relay state, or wctx query strings. This adds support for reading it directly from the Extensions element in the SAMLRequest, taking precedence over all other sources.

Changes

  • SPIDOptions — New configurable SpidLElementName property (default: "ext:spidL"), paired with the existing ExtensionsElementName ("samlp:Extensions"). Both are now surfaced in appsettings.json.
  • RequestSAMLAsXMLExtensions — New GetSpidLFromExtensions() extension method, following the same pattern as GetSpidACSFromExtensions(). Handles both prefixed (ext:spidL) and unprefixed element names.
  • ISPIDService / SPIDServiceGetSPIDLValue gains an optional XmlDocument requestAsXml parameter. When provided, Extensions are checked first; validity rules (ValidSPIDL list) apply equally to this path. Falls back to existing referer → relaystate → wctx → default chain on miss or invalid value.
  • FederatorRequestService — Passes requestAsXml to GetSPIDLValue.

Priority order (updated)

  1. ext:spidL inside samlp:Extensions of the SAMLRequest ← new
  2. Referer query string
  3. RelayState query string
  4. WCTX query string
  5. Configured default

Example SAMLRequest fragment that will now be honoured:

<samlp:Extensions>
  <ext:spidL xmlns:ext="...">2</ext:spidL>
</samlp:Extensions>

@mtagliaferri86
mtagliaferri86 marked this pull request as ready for review July 9, 2026 10:39
Copilot AI changed the title [WIP] Add extraction of spidL from SAMLRequest authentication extensions Read spidL from SAMLRequest Authentication Extensions (highest priority) Jul 9, 2026
Copilot AI requested a review from mtagliaferri86 July 9, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read the spidL from SAMLRequest Authentication Extensions

2 participants