Modifier and Type | Field and Description |
---|---|
static String |
BUNDLE_NAME |
static String |
COMPOSITE_ADVICE |
static String |
DEFAULT_CLIENT_TYPE |
static String |
ERROR_MESSAGE |
static String |
ERROR_TEMPLATE |
static String |
MSG_DELIMITER |
protected static RedirectUrlValidator<String> |
REDIRECT_URL_VALIDATOR |
static String |
templatePath |
Modifier | Constructor and Description |
---|---|
protected |
AuthClientUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
addLogoutCookieToURL(String url,
String logoutCookie,
boolean isCookieSupported)
Adds Logout cookie to URL.
|
static boolean |
checkForCookies(javax.servlet.http.HttpServletRequest req) |
static boolean |
checkForForcedAuth(String xmlCompositeAdvice)
Returns true if the composite Advice has the ForceAuth element
|
static boolean |
checkSessionUpgrade(SSOToken ssoToken,
Hashtable reqDataHash) |
static void |
clearHostUrlCookie(javax.servlet.http.HttpServletResponse response) |
static void |
clearlbCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
clearServerCookie(String cookieName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Clears server cookie.
|
static String |
constructLoginURL(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.http.Cookie |
createCookie(String cookieValue,
String cookieDomain)
Returns Cookie to be set in the response.
|
static javax.servlet.http.Cookie |
createCookie(String name,
String value,
int maxAge,
String cookieDomain) |
static javax.servlet.http.Cookie |
createCookie(String cookieName,
String cookieValue,
String cookieDomain)
Creates a Cookie with the
cookieName ,
cookieValue for the cookie domains specified. |
static javax.servlet.http.Cookie |
createlbCookie(String cookieDomain) |
static String |
encodeURL(String url,
javax.servlet.http.HttpServletRequest request,
AuthContext ac)
( Returns URL with the cookie value in the URL.
|
static String |
escapePipe(String text)
Replaces
| with "|". |
static boolean |
forceAuthFlagExists(Hashtable reqDataHash)
Returns true if the request has the ForceAuth=
true
query parameter or composite advise. |
static String |
getAuthCookieName()
Returns the Auth Cookie Name.
|
static String |
getAuthCookieValue(javax.servlet.http.HttpServletRequest request) |
static String |
getCharSet(String clientType,
Locale locale)
return the charset associated with the clientType
|
static String |
getClientType(javax.servlet.http.HttpServletRequest req)
Returns the client type.
|
static String |
getClientURLFromString(String urlString,
int index,
javax.servlet.http.HttpServletRequest request)
Extracts the client URL from the String passed
URL passed is in the format clientType | URL
|
static String |
getContentType(String clientType)
return the contentType associated with a clientType
if no contentType found then return the default
|
static boolean |
getCookieDetect(String cookieSupport)
Returns true if cookieDetect mode else false.
|
static Set<String> |
getCookieDomains()
Return the set of cookie domains configured in Platform settings.
|
static Set<String> |
getCookieDomainsForRequest(javax.servlet.http.HttpServletRequest request)
Find the cookie domains from the cookie domain list based on the hostname of the incoming request.
|
static String |
getCookieName() |
static javax.servlet.http.Cookie |
getCookieString(AuthContext ac,
String cookieDomain)
Returns the Cookie object created based on the
cookieName ,
Session ID and cookieDomain . |
static String |
getCookieSupport(String clientType)
for url rewriting with session id we need to know whether
cookies are supported
RFE 4412286
|
static String |
getCookieURL(SessionID sessionID) |
static String |
getCookieURLForSessionUpgrade(javax.servlet.http.HttpServletRequest request) |
static String |
getDataFromRealmQualifiedData(String realmQualifedData)
Returns the data from Realm qualified data.
|
static String |
getDefaultClientType()
Get default client
|
static String |
getDefaultFileName(javax.servlet.http.HttpServletRequest request,
String fileName,
Locale locale,
javax.servlet.ServletContext servletContext)
Returns the resource based on the default values.
|
static String |
getDefaultProperty(String property)
return the requested property for default client
|
static String |
getDistAuthCookieName()
Returns the Dist Auth Cookie Name.
|
static String |
getDomainNameByRequest(javax.servlet.http.HttpServletRequest request,
Map<String,String> requestHash)
This method determines the org parameter
and determines the organization DN based on
query parameters.
|
static String |
getDomainNameByRequest(Map<String,String> requestHash)
Deprecated.
use
#getDomainNameByRequest(
javax.servlet.http.HttpServletRequest, java.util.Map instead. |
static String |
getDSAMEVersion() |
static Map |
getEnvMap(javax.servlet.http.HttpServletRequest request)
Returns an environment map which contains all query parameters
and HTTP headers.
|
static String |
getErrorMessage(String errorCode) |
static String |
getErrorTemplate(String errorCode) |
static String |
getErrorVal(String errorCode,
String type) |
static String |
getErrorVal(String errorCode,
String type,
ResourceBundle bundle) |
static SSOToken |
getExistingValidSSOToken(SessionID sessID) |
static String |
getFileName(String fileName,
String localeName,
String orgDN,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.ServletContext servletContext,
AuthContext.IndexType indexType,
String indexName)
Returns the File name based on the given input values.
|
static String |
getFilePath(javax.servlet.http.HttpServletRequest request,
AuthContext.IndexType indexType,
String indexName) |
static String |
getFilePath(String clientType)
return the filePath associated with a clientType
|
protected static String |
getFileRoot() |
static String |
getHostName(javax.servlet.http.HttpServletRequest servletRequest) |
static String |
getIndexName(SSOToken ssoToken,
AuthContext.IndexType indexType) |
static AuthContext.IndexType |
getIndexType(String strIndexType) |
static String |
getlbCookieName() |
static String |
getlbCookieValue() |
static javax.servlet.http.Cookie |
getLogoutCookie(SessionID sid,
String cookieDomain)
Returns the Logout cookie.
|
static String |
getLogoutCookieString(SessionID sid)
Returns the encrpted Logout cookie string .
|
static String |
getOrganizationDN(String orgParam,
boolean noQueryParam,
javax.servlet.http.HttpServletRequest request) |
static String |
getOrgFilePath(String orgDN) |
static String |
getOrgParam(Map<String,String> requestHash)
Returns the org or domain parameter passed as a query in the request.
|
static String |
getOrigRedirectURL(javax.servlet.http.HttpServletRequest request,
SessionID sessID) |
static String |
getQueryOrgName(javax.servlet.http.HttpServletRequest request,
String org) |
static String |
getQueryStrFromParameters(Map paramMap) |
static String |
getRealmFromPolicyAdvice(String advice)
Parses the policy condition advice and checks for realm advices
|
static String |
getResourceLocation(String fileRoot,
String localeName,
String orgFilePath,
String filePath,
String filename,
String templatePath,
javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request) |
static String |
getResourceURL(javax.servlet.http.HttpServletRequest request)
Returns the resource URL.
|
static String |
getRootSuffix() |
static String |
getServiceURI()
Returns the service URI
|
static SessionID |
getSessionIDFromRequest(javax.servlet.http.HttpServletRequest request)
Returns the Session ID for this request.
|
static String |
getValidFQDNResource(String partialHostName,
javax.servlet.http.HttpServletRequest servletRequest)
Returns the valid hostname from the fqdn map and constructs the correct
URL.
|
static boolean |
isClientDetectionEnabled() |
static boolean |
isContain(String value,
String key) |
static boolean |
isCookieSet(javax.servlet.http.HttpServletRequest req) |
static boolean |
isCookieSupported(javax.servlet.http.HttpServletRequest req) |
static boolean |
isDistAuthServerTrusted(String distAuthServerLoginURL) |
static boolean |
isGenericHTMLClient(String clientType)
determine if this client is an html client
|
static boolean |
isLocalServer(String cookieURL,
boolean isServer) |
static boolean |
isLocalServer(String cookieURL,
String inputURI) |
static boolean |
isServerMemberOfLocalSite(String cookieURL) |
static boolean |
isSessionUpgradeOrForceAuth(javax.servlet.http.HttpServletRequest request)
Tells whether the incoming request corresponds to a session upgrade or ForceAuth.
|
static boolean |
isSetCookie(String clientType) |
static boolean |
isTimedOut(SessionID sessID) |
static boolean |
isUrlRewrite(String clientType) |
static boolean |
isValidFQDNRequest(String hostName)
Returns
true if the host name in the URL is valid. |
static boolean |
isVersionHeaderEnabled() |
static boolean |
isZeroPageLoginAllowed(ZeroPageLoginConfig config,
javax.servlet.http.HttpServletRequest request)
Determines whether Zero Page Login (ZPL) should be allowed for this request.
|
static boolean |
newSessionArgExists(Hashtable reqDataHash)
Returns
true if the request has the
arg=newsession query parameter. |
static Hashtable |
parseRequestParameters(javax.servlet.http.HttpServletRequest request) |
static boolean |
persistAMCookie(Hashtable reqDataHash)
Checks whether OpenAM session cookie has to be made
persistent.
|
static void |
printCookies(javax.servlet.http.HttpServletRequest req) |
static void |
printHash(Hashtable reqParameters) |
static Map<String,Object> |
sendAuthRequestToOrigServer(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String cookieURL)
Sends the request to the original Auth server and receives the result
data.
|
static boolean |
setCookieVal(String clientType,
String value) |
static void |
setHostUrlCookie(javax.servlet.http.HttpServletResponse response) |
static void |
setlbCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
setRedirectBackServerCookie(String cookieName,
String cookieValue,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets the redirectBackUrlCookie to be set as OpenAM
server URL when redirecting to external web site during authentication
process.
|
static void |
setServerCookie(javax.servlet.http.Cookie aCookie,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets server cookie to
HttpServletResponse object |
static String |
unescapePipe(String text)
Returns unescaped text.
|
protected static String |
URLencodedSunQueryParamsString(String queryParams,
String encoding)
This method takes in a String representing base64 decoded
SunQueryParamsString and URL encodes all the parameters
included in its value
|
public static final String DEFAULT_CLIENT_TYPE
public static final String COMPOSITE_ADVICE
public static final String ERROR_MESSAGE
public static final String ERROR_TEMPLATE
public static final String MSG_DELIMITER
public static final String BUNDLE_NAME
public static final String templatePath
protected static final RedirectUrlValidator<String> REDIRECT_URL_VALIDATOR
public static Hashtable parseRequestParameters(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.Cookie getLogoutCookie(SessionID sid, String cookieDomain)
sid
- Session ID.cookieDomain
- Cookie domain.public static String getLogoutCookieString(SessionID sid)
LOGOUT@protocol@servername@serverport@sessiondomain
.sid
- the SessionIDpublic static javax.servlet.http.Cookie createCookie(String cookieValue, String cookieDomain)
cookieValue
- value of cookiecookieDomain
- domain for which cookie will be set.public static String getQueryOrgName(javax.servlet.http.HttpServletRequest request, String org)
public static void printCookies(javax.servlet.http.HttpServletRequest req)
public static void printHash(Hashtable reqParameters)
public static void setlbCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthException
AuthException
public static javax.servlet.http.Cookie createCookie(String cookieName, String cookieValue, String cookieDomain)
cookieName
,
cookieValue
for the cookie domains specified.cookieName
- is the name of the cookiecookieValue
- is the value fo the cookiecookieDomain
- Domain for which the cookie is to be set.public static void clearlbCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static boolean checkForCookies(javax.servlet.http.HttpServletRequest req)
public static String getOrigRedirectURL(javax.servlet.http.HttpServletRequest request, SessionID sessID)
public static String addLogoutCookieToURL(String url, String logoutCookie, boolean isCookieSupported)
url
- is the url to be rewritten with the logout cookielogoutCookie
- is the logoutCookie StringisCookieSupported
- is a boolean which indicates whether
cookie support is true or falsepublic static SessionID getSessionIDFromRequest(javax.servlet.http.HttpServletRequest request)
com.iplanet.am.auth.cookie
,
and for active/inactive sessions in com.iplanet.am.cookie
.request
- HTTP Servlet Request.public static boolean newSessionArgExists(Hashtable reqDataHash)
true
if the request has the
arg=newsession
query parameter.reqDataHash
- Request Data Hashtable.
returns true
if this parameter is present.public static AuthContext.IndexType getIndexType(String strIndexType)
public static String getIndexName(SSOToken ssoToken, AuthContext.IndexType indexType)
public static boolean checkSessionUpgrade(SSOToken ssoToken, Hashtable reqDataHash)
public static boolean isSessionUpgradeOrForceAuth(javax.servlet.http.HttpServletRequest request)
request
- The incoming HttpServletRequest.true
if the request corresponds to a session upgrade or ForceAuth, false
otherwise.public static String getCookieURLForSessionUpgrade(javax.servlet.http.HttpServletRequest request)
public static boolean isClientDetectionEnabled()
public static String getClientType(javax.servlet.http.HttpServletRequest req)
ClientDetector
class otherwise
defaultClientType
set in
iplanet-am-client-detection-default-client-type
is assumed to be the client type.req
- HTTP Servlet Request.public static String getDefaultClientType()
public static String getDefaultProperty(String property)
public static String getCharSet(String clientType, Locale locale)
public static String getFilePath(String clientType)
public static String getContentType(String clientType)
public static String getCookieSupport(String clientType)
public static boolean isGenericHTMLClient(String clientType)
public static boolean isSetCookie(String clientType)
public static boolean getCookieDetect(String cookieSupport)
cookieSupport
- , whether cookie is supported or not.public static String getClientURLFromString(String urlString, int index, javax.servlet.http.HttpServletRequest request)
urlString
- is a String , a URLindex
- is the position of delimiter "|"public static boolean isUrlRewrite(String clientType)
public static String getDSAMEVersion()
public static boolean isVersionHeaderEnabled()
public static String getAuthCookieName()
public static String getDistAuthCookieName()
public static String getCookieName()
public static String getlbCookieName()
public static String getlbCookieValue()
public static Set<String> getCookieDomains()
getCookieDomainsForRequest(HttpServletRequest)
instead.public static Set<String> getCookieDomainsForRequest(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest request.public static String getOrganizationDN(String orgParam, boolean noQueryParam, javax.servlet.http.HttpServletRequest request)
public static String getDomainNameByRequest(javax.servlet.http.HttpServletRequest request, Map<String,String> requestHash)
request
- HTTP Servlet Request object.requestHash
- Query Hashtable.public static String getOrgParam(Map<String,String> requestHash)
requestHash
- Hashtable containing the query parameterspublic static boolean isValidFQDNRequest(String hostName)
true
if the host name in the URL is valid.hostName
- Host name.true
if the host name in the URL is valid.public static String getValidFQDNResource(String partialHostName, javax.servlet.http.HttpServletRequest servletRequest)
partialHostName
- Partial host name.servletRequest
- HTTP Servlet Request.public static String getHostName(javax.servlet.http.HttpServletRequest servletRequest)
public static String constructLoginURL(javax.servlet.http.HttpServletRequest request)
protected static String URLencodedSunQueryParamsString(String queryParams, String encoding)
public static boolean isTimedOut(SessionID sessID)
public static String getErrorVal(String errorCode, String type, ResourceBundle bundle)
public static boolean isCookieSupported(javax.servlet.http.HttpServletRequest req)
public static boolean isCookieSet(javax.servlet.http.HttpServletRequest req)
public static javax.servlet.http.Cookie createCookie(String name, String value, int maxAge, String cookieDomain)
public static javax.servlet.http.Cookie createlbCookie(String cookieDomain) throws AuthException
AuthException
public static javax.servlet.http.Cookie getCookieString(AuthContext ac, String cookieDomain)
cookieName
,
Session ID and cookieDomain
.
If AuthContext,/code> status is not SUCCESS
then
cookie is created with authentication cookie Name, else AM Cookie Name
will be used to create cookie.
ac
- the AuthContext objectcookieDomain
- the cookie domain for creating cookie.public static String encodeURL(String url, javax.servlet.http.HttpServletRequest request, AuthContext ac)
url
- URL to be encoded.request
- HTTP Servlet Request.ac
- Authentication Context.public static String getDefaultFileName(javax.servlet.http.HttpServletRequest request, String fileName, Locale locale, javax.servlet.ServletContext servletContext)
request
- HTTP Servlet Request.fileName
- name of the filelocale
- Locale used for the search.servletContext
- Servlet Context for serverpublic static String getRootSuffix()
protected static String getFileRoot()
public static String getResourceLocation(String fileRoot, String localeName, String orgFilePath, String filePath, String filename, String templatePath, javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request)
public static String getFilePath(javax.servlet.http.HttpServletRequest request, AuthContext.IndexType indexType, String indexName)
public static String getFileName(String fileName, String localeName, String orgDN, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.ServletContext servletContext, AuthContext.IndexType indexType, String indexName)
fileName
- Name of the file.localeName
- Locale name.orgDN
- Organization distinguished name.servletRequest
- HTTP Servlet Request.servletContext
- Servlet Context for server.indexType
- AuthContext Index Type.indexName
- index name associated with the index type.public static String getAuthCookieValue(javax.servlet.http.HttpServletRequest request)
public static String getDomainNameByRequest(Map<String,String> requestHash)
#getDomainNameByRequest(
javax.servlet.http.HttpServletRequest, java.util.Map)
instead.public static String getRealmFromPolicyAdvice(String advice)
advice
- The policy advice XMLIllegalArgumentException
- if more than one realm is defined within
the adviceAMAuthUtils
public static boolean isLocalServer(String cookieURL, boolean isServer)
public static boolean isServerMemberOfLocalSite(String cookieURL)
public static Map<String,Object> sendAuthRequestToOrigServer(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String cookieURL)
request
- HttpServletRequest to be sentresponse
- HttpServletResponse to be receivedcookieURL
- URL of the original authentication server to be
connectedpublic static void setServerCookie(javax.servlet.http.Cookie aCookie, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthException
HttpServletResponse
objectaCookie
- auth context associated with lb cookieresponse
- true
if it is persistentAuthException
- if it fails to create pcookiepublic static void setRedirectBackServerCookie(String cookieName, String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthException
cookieName
- auth context associated with lb cookiecookieValue
- auth context associated with lb cookieresponse
- true
if it is persistentAuthException
- if it fails to create this cookiepublic static void clearServerCookie(String cookieName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
cookieName
- Cookie Name.response
- HTTP Servlet Response.public static boolean persistAMCookie(Hashtable reqDataHash)
true
is providued for HTTP query
parameter Constants.PERSIST_AM_COOKIE
and this property is
enabled or if persistent cookies are set globally.
If either of these are true, AM session cookie will be made persistentreqDataHash
- http request parameters and valuestrue
if AM session cookie has to be made persistent,
otherwise returns false
public static boolean forceAuthFlagExists(Hashtable reqDataHash)
true
query parameter or composite advise.public static boolean checkForForcedAuth(String xmlCompositeAdvice)
public static String getServiceURI()
public static void setHostUrlCookie(javax.servlet.http.HttpServletResponse response)
public static void clearHostUrlCookie(javax.servlet.http.HttpServletResponse response)
public static boolean isDistAuthServerTrusted(String distAuthServerLoginURL)
public static String getResourceURL(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest objectpublic static Map getEnvMap(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest object.public static String unescapePipe(String text)
text
- String to be unescaped.public static String escapePipe(String text)
|
with "|".public static String getDataFromRealmQualifiedData(String realmQualifedData)
realmQualifedData
- Realm qualified data. This could be Realm
qualified authentication scheme or authentication level or service.public static boolean isZeroPageLoginAllowed(ZeroPageLoginConfig config, javax.servlet.http.HttpServletRequest request)
config
- the ZPL configuration.request
- the HTTP request.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.