Skip to content

feat(cas-auth): support configuring an absolute callback URL#13413

Merged
shreemaan-abhishek merged 2 commits into
apache:masterfrom
shreemaan-abhishek:feat/cas-auth-configurable-callback
May 25, 2026
Merged

feat(cas-auth): support configuring an absolute callback URL#13413
shreemaan-abhishek merged 2 commits into
apache:masterfrom
shreemaan-abhishek:feat/cas-auth-configurable-callback

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Description

The cas-auth plugin assembles the CAS service parameter (the callback URL sent to the CAS identity provider) from the request scheme, Host header and port plus cas_callback_uri.

This PR lets operators configure cas_callback_uri as an absolute URL. When it is absolute (matches ^https?://), it is used verbatim as the CAS service URL and the request-derived construction is skipped. The relative-path form keeps its existing behaviour, and check_schema logs a warning at config-load time when the relative form is used so operators are aware the service URL is derived from the request Host header.

The callback path matched against ctx.var.uri for incoming IdP callbacks is now derived from cas_callback_uri, so matching keeps working when an absolute URL is configured.

New cases in t/plugin/cas-auth.t cover the absolute-URL form, the relative-path form, and the path-derivation helper.

This change is backward compatible: existing relative-path configurations behave exactly as before.

Which issue(s) this PR fixes:

N/A

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@shreemaan-abhishek
shreemaan-abhishek marked this pull request as ready for review May 22, 2026 05:48
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 22, 2026
@shreemaan-abhishek
shreemaan-abhishek merged commit e86c4fb into apache:master May 25, 2026
19 checks passed
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants