Skip to content

providers/saml: handle XML declarations in unified endpoint (cherry-pick #22455 to version-2026.5) - #22539

Merged
PeshekDotDev merged 1 commit into
version-2026.5from
cherry-pick/22455-to-version-2026.5
May 21, 2026
Merged

PeshekDotDev merged 1 commit into
version-2026.5from
cherry-pick/22455-to-version-2026.5

Conversation

@authentik-automation

Copy link
Copy Markdown
Contributor

Cherry-pick of #22455 to version-2026.5 branch.

Original PR: #22455
Original Author: @dominic-r
Cherry-picked commit: 495076a

* providers/saml: handle XML declarations in unified endpoint

The unified SAML endpoint decodes redirect-binding payloads to a Unicode string and then passes that string to lxml. When an SP sends an XML declaration with an encoding, lxml raises before authentik can detect whether the message is an AuthnRequest or LogoutRequest, and the endpoint reports an unknown SAML message type.

Encode decoded redirect payloads back to bytes before XML parsing so lxml can honor the declaration. Add regression coverage for redirect-binding AuthnRequest and LogoutRequest payloads with XML declarations.

Validation: .venv/bin/python -m pytest authentik/providers/saml/tests/test_views_unified.py; uv run ruff check authentik/providers/saml/views/unified.py authentik/providers/saml/tests/test_views_unified.py

Agent-thread: https://sdko.org/internal/threads/019e3d5c-1579-7533-813c-1d7da8b7b01b

Co-authored-by: Agent <[email protected]>

* providers/saml: Use fixtures for unified request tests

Move the inline SAML request XML into fixtures so the unified endpoint tests use reusable request bodies while preserving XML declaration coverage.

Agent-thread: https://sdko.org/internal/threads/019e431d-86e3-7200-8079-e8bcb390183b
Co-authored-by: Agent <[email protected]>

---------

Co-authored-by: Agent <[email protected]>
@netlify

netlify Bot commented May 21, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 87f4ee6
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a0f34df88eb690008bae984
😎 Deploy Preview https://deploy-preview-22539--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented May 21, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 87f4ee6
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a0f34dfbb5ee10008ac1d6f
😎 Deploy Preview https://deploy-preview-22539--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented May 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.29%. Comparing base (0dd78eb) to head (87f4ee6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@               Coverage Diff               @@
##           version-2026.5   #22539   +/-   ##
===============================================
  Coverage           93.29%   93.29%           
===============================================
  Files                1032     1033    +1     
  Lines               60061    60074   +13     
  Branches              400      400           
===============================================
+ Hits                56031    56045   +14     
+ Misses               4030     4029    -1     
Flag Coverage Δ
conformance 36.60% <0.00%> (-0.01%) ⬇️
e2e 41.84% <15.38%> (-0.02%) ⬇️
integration 33.04% <0.00%> (-0.01%) ⬇️
rust 0.00% <ø> (ø)
unit 92.22% <100.00%> (+0.01%) ⬆️
unit-migrate 92.26% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-87f4ee6b54a60132e2f71718c7c65fd84c19f04b
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-87f4ee6b54a60132e2f71718c7c65fd84c19f04b

Afterwards, run the upgrade commands from the latest release notes.

@PeshekDotDev
PeshekDotDev merged commit ae9f11e into version-2026.5 May 21, 2026
104 checks passed
@PeshekDotDev
PeshekDotDev deleted the cherry-pick/22455-to-version-2026.5 branch May 21, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants