Skip to content

Clarify goto URL validation for web policy agents - #1280

Merged
vharseko merged 5 commits into
OpenIdentityPlatform:masterfrom
vharseko:docs/clarify-agent-goto-validation
Dec 4, 2026
Merged

vharseko merged 5 commits into
OpenIdentityPlatform:masterfrom
vharseko:docs/clarify-agent-goto-validation

Conversation

@vharseko

@vharseko vharseko commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Starting with OpenAM 16.1.4, the default empty list of Valid goto URL Resources allows relative URLs. An absolute URL qualifies without a list entry only when it has a recognized OpenAM origin and its path is within the OpenAM deployment context. If OpenAM runs at https://am.example.com/openam, a user can sign in successfully and still miss the redirect to https://am.example.com/reports unless the authentication realm allows that destination.

The Configuration Reference and Administration Guide explain this rule, including how the realm uses the service defaults. The Web Policy Agent troubleshooting guide shows where to add destinations for co-hosted applications and sibling subdomains, with examples for the application root, a protected path, and a query string. This answers the login question in discussion #1006. The related logout change is tracked in PR #1279.

The Administration Guide also explains how the Validation Service handles an omitted port. A literal http or https scheme uses port 80 or 443, respectively. The http* and https* scheme patterns match any port when the port is omitted. The guide lists the supported HTTP(S) scheme forms for absolute goto patterns and shows separate HTTP and HTTPS patterns for deployments that allow only the standard ports. Authorization Policies also shows how to use an explicit :* with a *:// scheme and a fixed host.

Antora rendered all four updated pages. I checked the cross-references and verified that the wildcard examples rendered as literal code. A focused check of the OpenAM 16.1.4 comparators confirmed that http* and https* patterns without a port match HTTPS on 8443. For the same URL, a fixed-host *:// pattern matched the nonrecursive policy comparison with an explicit :*. The two literal-scheme patterns restrict HTTP to 80 and HTTPS to 443. All seven Antora page title tests and all eight documentation checker tests passed, with no errors in 145 How-To references across 56 pages.

@vharseko vharseko added the documentation Documentation, README, or javadoc label Dec 4, 2026
@vharseko
vharseko requested a review from maximthomas December 4, 2026 09:44

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The troubleshooting guide gives concrete allowlist examples for the application root, a protected path, and a query string.


issue (blocking): An absolute goto on the OpenAM origin still needs a realm allowlist entry if it points outside OpenAM's deployment context.

Location at HEAD. Configuration Reference, line 4631, Web Policy Agent troubleshooting, line 74.

The base describes an empty list as accepting any goto. Both new hunks replace that claim with a rule that permits “absolute URLs on a recognized OpenAM origin,” which gives administrators an incomplete test for deciding whether an entry is needed. With OpenAM at https://openam.example.com/openam, the agent's absolute return URL https://openam.example.com/reports has the same origin and still falls back after successful login when the list is empty. The shared validator requires both conditions before bypassing the realm list. The validator blob is identical at tag 16.1.4, the base, and HEAD. Base wording, validator at HEAD, authentication fallback.

if (isSameOrigin(request, uri, configInfos) && isWithinDeploymentUri(request, uri)) {
    return true;
}

A focused check compiled from HEAD used a servlet request with context /openam. The same absolute application URL was rejected with the empty list and accepted after adding that exact URL to the list.

Empty list       https://openam.example.com/openam/XUI/  true
Empty list       https://openam.example.com/reports      false
With exact entry https://openam.example.com/reports      true

The existing empty-list test also asserts rejection for a same-origin URL under /otherapp. An independent read confirmed the source behavior, the test coverage, and the finding's scope. Existing regression test.

Closure criterion State in both pages that an absolute URL must also be within the OpenAM deployment context to qualify under the empty-list default. In troubleshooting, tell administrators to add a matching realm entry for an absolute return URL to a co-hosted application outside that context.

@vharseko

vharseko commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

@maximthomas, addressed in b84ee46. The Configuration Reference and Web Policy Agent troubleshooting guide now state both conditions for accepting an absolute URL without a realm entry. The troubleshooting example shows why https://am.example.com/reports needs a matching entry when OpenAM runs at https://am.example.com/openam. I also updated the linked Administration Guide to use the same rule, including when OpenAM cannot read the configuration store.

I verified the example in the rendered troubleshooting page and checked that both links reach the updated Administration Guide section.

@vharseko
vharseko requested a review from maximthomas December 4, 2026 11:28

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The troubleshooting example tells an administrator running OpenAM under /openam exactly which return URL needs a realm entry. Troubleshooting at HEAD.

@vharseko
vharseko requested a review from maximthomas December 4, 2026 12:24

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The new examples distinguish an absent query from an empty query and preserve both wildcard forms as literal code in the rendered pages. Authentication Services, Authorization Policies.


issue (blocking): The default-port rule needs an exception for a wildcard scheme.

Authentication Services at HEAD, line 5448.

The previous wording illustrated omitted ports with literal HTTP and HTTPS URLs. The new sentence explicitly extends the default-port rule to any URL or pattern and immediately follows it with an http* example. The redirect matcher normalizes an omitted port to 80 or 443 for a literal scheme and to a port wildcard for a wildcard scheme. An administrator who relies on the new wording can allow applications on alternate ports while intending to allow only the standard HTTP and HTTPS ports. Previous wording, redirect matcher at HEAD, port normalization at HEAD.

A focused check compiled the matching code from HEAD and compared each pattern with https://app.example.com:8443/reports.

Configured pattern               Canonical pattern                   Matches
http*://app.example.com/reports   http*://app.example.com:*/reports    true
https://app.example.com/reports   https://app.example.com:443/reports false

An independent check confirmed the same difference with the guide's own wildcard scheme and host example at a custom HTTPS port. The configured-list path calls the same matcher, and the port normalization code is identical at both reviewed revisions. Configured-list validation at HEAD.

Closure criterion Limit the omitted-port default to literal http and https schemes. State that omitting the port with a wildcard scheme matches any port. For a configuration that permits only the scheme defaults, document using separate patterns with literal HTTP and HTTPS schemes.

@vharseko

vharseko commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

@maximthomas, I addressed the omitted-port finding in 43a6f738ad.

Authentication Services now specifies that an omitted port defaults to 80 for literal http and 443 for literal https. With a wildcard scheme such as http*, an omitted port matches any port. The guide shows separate HTTP and HTTPS patterns for deployments that allow only the standard ports. Authorization Policies now states the same rule.

I checked both sections in Antora and verified the patterns against the OpenAM 16.1.4 matcher. The http* example matched HTTPS on 8443. The two literal-scheme patterns restricted HTTP to 80 and HTTPS to 443.

@vharseko
vharseko requested a review from maximthomas December 4, 2026 12:59

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The two literal-scheme patterns give administrators a concrete way to restrict return URLs to the HTTP and HTTPS default ports. Authentication Services at HEAD.


issue (blocking): Limit implicit wildcard ports to HTTP(S) scheme patterns.

Authentication Services at HEAD, line 5450, Authorization Policies at HEAD, line 602.

The previous revision described omitted ports as scheme defaults. The new lines promise that omitting a port with a wildcard scheme matches any port, and Authorization Policies makes that promise immediately after a bare *:// example. Following the new guidance for a fixed application host can cause a policy to miss requests on that host. Copying that policy syntax into Valid goto URL Resources can also cause the application redirect to fall back. Previous Authentication Services wording, previous Authorization Policies wording, authentication fallback at HEAD.

The port insertion logic runs for the HTTP(S) scheme family. A bare *:// skips it in the policy comparator, and the redirect matcher treats that pattern as relative. The shared matcher and policy comparator have identical source at both reviewed revisions. Accepted scheme patterns, normalization guard, implicit port logic, redirect matching.

HEAD matcher output for https://app.example.com:8443/reports with three administrator-configured patterns:

Pattern                         Policy wildcard pass   Configured goto match
http*://app.example.com/reports wildcard_match         true
*://app.example.com/reports     sub_resource_match     false
*://app.example.com:*/reports   wildcard_match         false

The independent check repeated both comparison passes of nonrecursive entitlement evaluation. The second row returned no_match for the exact pass and sub_resource_match for the wildcard pass, so the policy excluded that resource pattern. The configured redirect list calls the matcher exercised by the probe. Nonrecursive entitlement evaluation, configured allowlist path.

Closure criterion State in both sections that an omitted port becomes a wildcard for HTTP(S) scheme patterns such as http* and https*. In the policy guide, retain explicit :* in the bare-scheme example and explain that a bare-scheme pattern with a fixed host needs a port wildcard to cover all ports. In Authentication Services, clarify that absolute goto patterns use the supported HTTP(S) schemes and wildcard forms.

@vharseko

vharseko commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

@maximthomas, I addressed the wildcard scheme finding in a7dadacab8.

Both sections now limit the implicit port wildcard to http* and https*. Authentication Services lists the supported scheme forms for absolute goto patterns and explains how the Validation Service interprets *:// patterns. Authorization Policies keeps the explicit :* in the existing example and adds *://app.example.com:*/reports for a fixed host.

I checked both comparators on HTTPS port 8443 and verified the examples and cross-reference in the rendered Antora pages. All seven Antora page title tests and all eight documentation checker tests passed.

@vharseko
vharseko requested a review from maximthomas December 4, 2026 13:49

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The fixed-host example shows administrators where to put the explicit port wildcard in a *:// policy pattern. Authorization Policies at HEAD.

@vharseko
vharseko merged commit 1d324e5 into OpenIdentityPlatform:master Dec 4, 2026
13 of 14 checks passed
@vharseko
vharseko deleted the docs/clarify-agent-goto-validation branch December 4, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation, README, or javadoc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants