T - The type of the configuration information that is provided to find the collection of valid domains.public class RedirectUrlValidator<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
GOTO
Go to url query parameter name.
|
static String |
GOTO_ON_FAIL
Go to on fail query parameter name.
|
| Constructor and Description |
|---|
RedirectUrlValidator(ValidDomainExtractor<T> domainExtractor)
Constructs a new RedirectUrlValidator instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAndDecodeParameter(javax.servlet.http.HttpServletRequest request,
String paramName)
Helper function to retrieve a field from the provided request's query parameters.
|
String |
getRedirectUrl(T configInfo,
String gotoUrl,
String alternateUrl)
Returns the appopriate redirectUrl, given the options of the provided URL and the default one, as well
as a configuration.
|
String |
getValueFromJson(org.forgerock.json.JsonValue input,
String paramName)
Helper function to retrieve a field from the provided request's JSON POST data.
|
boolean |
isRedirectUrlValid(String url,
T configInfo)
Validates the provided redirect URL against the collection of valid goto URL domains found based on the
configuration info.
|
public static final String GOTO
public static final String GOTO_ON_FAIL
public RedirectUrlValidator(ValidDomainExtractor<T> domainExtractor)
domainExtractor - A ValidDomainExtractor instance.public boolean isRedirectUrlValid(String url, T configInfo)
url - The URL that needs to be validated. May be null.configInfo - The necessary information about the configuration to determine the collection of valid goto
URL domains. May not be null.true if the provided URL is valid, false otherwise.public String getRedirectUrl(T configInfo, String gotoUrl, String alternateUrl)
configInfo - Config in the given type which informs the collection of valid domain URLs.gotoUrl - The goto URL to compare against the config. If null alternateUrl will be returned.alternateUrl - The URL to default to. May be null.public String getAndDecodeParameter(javax.servlet.http.HttpServletRequest request, String paramName)
request - Request containing the parameters to retrieve.paramName - The name of the parameter whose value to (possibly decode) return.public String getValueFromJson(org.forgerock.json.JsonValue input, String paramName)
input - JsonValue containing the key "goto" and a paired URL.paramName - The key whose value to attempt to read.Copyright © 2010–2023 Open Identity Platform Community. All rights reserved.