Skip to content

fix(saml): resolve SP by entityID via request body, not path param#71

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/fix-saml-sp-lookup
Jun 3, 2026
Merged

fix(saml): resolve SP by entityID via request body, not path param#71
BK1031 merged 1 commit into
mainfrom
bk1031/fix-saml-sp-lookup

Conversation

@BK1031

@BK1031 BK1031 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

SAML entity IDs are typically URLs (e.g. https://samlsp.com). The internal SP lookup used a single-segment path param (/core/saml/sp/entity/:entityID), so the :// and slashes split into extra path segments and gin never matched the route — every URL-shaped entityID returned the default 404 page not found, surfacing as cannot handle request from unknown service provider and a 400 at /saml/sso.

  • core: replace GET /core/saml/sp/entity/:entityID with POST /core/saml/sp/resolve, entityID in a JSON body (same POST-for-read pattern as /token/validate and /applications/verify)
  • saml: ResolveSP now POSTs the entityID instead of putting it in the path

Found while testing SP-initiated SSO against https://samlsp.com. Needs a release + redeploy before live SSO lookups succeed.

SAML entity IDs are typically URLs (https://sp.example.com/metadata); the
:// and slashes broke the single-segment :entityID path param, so the
internal SP lookup returned gin's 404 ("unknown service provider") for
every URL-shaped entityID. Move the lookup to POST /core/saml/sp/resolve
with the entityID in a JSON body — same POST-for-read pattern core already
uses for /token/validate and /applications/verify.
@BK1031 BK1031 merged commit acef135 into main Jun 3, 2026
15 checks passed
@BK1031 BK1031 deleted the bk1031/fix-saml-sp-lookup branch June 3, 2026 23:40
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.

1 participant