public class AuthUtils extends AuthClientUtils
Modifier and Type | Field and Description |
---|---|
static String |
BUNDLE_NAME |
static String |
FORCE_AUTH
Name of parameter used to indicate authn process MUST be run.
|
static int |
MODULE
Authentication type for Module based authentication after
Composite Advices
|
static int |
REALM
Authentication type for Realm based authentication after
Composite Advices
|
static int |
SERVICE
Authentication type for Service based authentication after
Composite Advices
|
COMPOSITE_ADVICE, DEFAULT_CLIENT_TYPE, ERROR_MESSAGE, ERROR_TEMPLATE, MSG_DELIMITER, REDIRECT_URL_VALIDATOR, templatePath
Modifier and Type | Method and Description |
---|---|
static boolean |
checkForCookies(javax.servlet.http.HttpServletRequest req,
AuthContextLocal ac)
Returns true if cookies found in the request.
|
static void |
clearAllCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
clearAllCookiesByDomain(SessionID sid,
String cookieDomain,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static javax.servlet.http.Cookie |
createlbCookie(AuthContextLocal authContext,
String cookieDomain) |
static void |
destroySession(AuthContextLocal authContext) |
static String |
encodeURL(String url,
AuthContextLocal authContext) |
static boolean |
forwardSuccessExists(javax.servlet.http.HttpServletRequest req)
Returns
true if the request has the
forward=true query parameter. |
static AuthContextLocal |
getAuthContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SessionID sid,
boolean isSessionUpgrade,
boolean isBackPost)
Returns the authentication context for a request.
|
static AuthContextLocal |
getAuthContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SessionID sessionId,
boolean isSessionUpgrade,
boolean isBackPost,
boolean isLogout,
boolean isRestAuth)
Returns the authentication context for a request.
|
static AuthContextLocal |
getAuthContext(javax.servlet.http.HttpServletRequest req,
String sessionID) |
static AuthContextLocal |
getAuthContext(String orgName) |
static AuthContextLocal |
getAuthContext(String orgName,
javax.servlet.http.HttpServletRequest req) |
static AuthContextLocal |
getAuthContext(String orgName,
String sessionID) |
static AuthContextLocal |
getAuthContext(String orgName,
String sessionID,
boolean logout) |
static AuthContextLocal |
getAuthContext(String orgName,
String sessionID,
boolean isLogout,
javax.servlet.http.HttpServletRequest req)
Returns the AuthContext Handle for the Request.
|
static AuthContextLocal |
getAuthContext(String orgName,
String sessionID,
boolean isLogout,
javax.servlet.http.HttpServletRequest req,
String indexType,
AuthXMLRequest xmlReq) |
static AuthContextLocal |
getAuthContext(String providedOrgName,
String sessionID,
boolean isLogout,
javax.servlet.http.HttpServletRequest req,
String indexType,
AuthXMLRequest xmlReq,
boolean forceAuth) |
static Set |
getAuthModules(int authLevel,
String organizationDN,
String clientType)
Returns a set of authentication modules whose authentication
level equals to or greater than the specified authLevel.
|
static Callback[] |
getCallbacksPerState(AuthContextLocal authContext,
String pageState) |
static int |
getCompositeAdviceType(AuthContextLocal authContext) |
static javax.servlet.http.Cookie |
getCookieString(AuthContextLocal ac,
String cookieDomain)
Returns the Cookie object created based on the cookie name,
Session ID and cookie domain.
|
static String |
getDefaultFileName(javax.servlet.http.HttpServletRequest request,
String fileName)
Returns the resource based on the default values.
|
static String |
getFileName(AuthContextLocal authContext,
String fileName) |
static Map |
getGlobalAttributes(String serviceName)
Returns
Map attributes |
static String |
getIndexName(AuthContextLocal authContext) |
static AuthContext.IndexType |
getIndexType(AuthContextLocal authContext) |
static boolean |
getInetDomainStatus(AuthContextLocal authContext) |
static String |
getLocale(AuthContextLocal authContext) |
static String |
getLoginFailedURL(AuthContextLocal authContext) |
static LoginState |
getLoginState(AuthContextLocal authContext) |
static String |
getLoginSuccessURL(AuthContextLocal authContext) |
static String |
getLoginURL(AuthContextLocal authContext) |
static javax.servlet.http.Cookie |
getLogoutCookie(AuthContextLocal ac,
String cookieDomain)
Returns the Logout cookie.
|
static String |
getModuleServiceName(String moduleName)
Get the module service name in either
iplanet-am-auth format
|
static InternalSession |
getOldSession(AuthContextLocal authContext) |
static String |
getOrgConfiguredAuthenticationChain(String orgDN)
Returns the authentication service or chain configured for the
given organization.
|
static String |
getOrgDN(AuthContextLocal authContext) |
static String |
getPostProcessURL(javax.servlet.http.HttpServletRequest servletRequest,
String attrName) |
static Callback[] |
getRecdCallback(AuthContextLocal authContext) |
static String |
getRemoteSecurityEnabled()
Returns true if remote Auth security is enabled and false otherwise
|
static InternalSession |
getSession(AuthContextLocal authContext) |
static String |
getSessionProperty(String property,
AuthContextLocal oldAuthContext) |
static String |
getSuccessURL(javax.servlet.http.HttpServletRequest request,
AuthContextLocal authContext)
Returns success URL for this request.
|
static String |
getValidGotoURL(javax.servlet.http.HttpServletRequest request,
String orgDN)
Returns valid goto parameter for this request.
|
static ZeroPageLoginConfig |
getZeroPageLoginConfig(String realm)
Gets the ZPL configuration for the given realm.
|
static boolean |
isCookieSet(AuthContextLocal ac) |
static boolean |
isCookieSupported(AuthContextLocal ac) |
static boolean |
isForwardSuccess(AuthContextLocal authContext,
javax.servlet.http.HttpServletRequest req)
Returns the flag indicating a request "forward" after
successful authentication.
|
static boolean |
isNewRequest(AuthContextLocal ac) |
static boolean |
isSessionUpgrade(AuthContextLocal authContext) |
static boolean |
logout(InternalSession intSession,
SSOToken token,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs a logout on a given token ensuring the post auth classes are called
|
static boolean |
logout(String sessionID,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs a logout on a given token ensuring the post auth classes are called
|
static boolean |
newSessionArgExists(Map<String,String> decodedRequestData,
SessionID sessionId) |
static Map |
processCompositeAdviceXML(String xmlCompositeAdvice,
String orgDN,
String clientType) |
static void |
removeAuthContext(SessionID sid)
Removes the AuthContextLocal object in the Session object identified
by the SessionID object parameter 'sid'.
|
static void |
resetPostProcessURLs(javax.servlet.http.HttpServletRequest servletRequest) |
static boolean |
sessionTimedOut(AuthContextLocal authContext)
Returns
true if the session has timed out or the page has
timed out. |
static void |
setCallbacksPerState(AuthContextLocal authContext,
String pageState,
Callback[] callbacks) |
static void |
setCookieSupported(AuthContextLocal ac,
boolean flag) |
static void |
setlbCookie(AuthContextLocal authContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
addLogoutCookieToURL, checkForCookies, checkForForcedAuth, checkSessionUpgrade, clearHostUrlCookie, clearlbCookie, clearServerCookie, constructLoginURL, createCookie, createCookie, createCookie, createlbCookie, encodeURL, escapePipe, forceAuthFlagExists, getAuthCookieName, getAuthCookieValue, getCharSet, getClientType, getClientURLFromString, getContentType, getCookieDetect, getCookieDomains, getCookieDomainsForRequest, getCookieName, getCookieString, getCookieSupport, getCookieURL, getCookieURLForSessionUpgrade, getDataFromRealmQualifiedData, getDefaultClientType, getDefaultFileName, getDefaultProperty, getDistAuthCookieName, getDomainNameByRequest, getDomainNameByRequest, getDSAMEVersion, getEnvMap, getErrorMessage, getErrorTemplate, getErrorVal, getErrorVal, getExistingValidSSOToken, getFileName, getFilePath, getFilePath, getFileRoot, getHostName, getIndexName, getIndexType, getlbCookieName, getlbCookieValue, getLogoutCookie, getLogoutCookieString, getOrganizationDN, getOrgFilePath, getOrgParam, getOrigRedirectURL, getQueryOrgName, getQueryStrFromParameters, getRealmFromPolicyAdvice, getResourceLocation, getResourceURL, getRootSuffix, getServiceURI, getSessionIDFromRequest, getValidFQDNResource, isClientDetectionEnabled, isContain, isCookieSet, isCookieSupported, isDistAuthServerTrusted, isGenericHTMLClient, isLocalServer, isLocalServer, isServerMemberOfLocalSite, isSessionUpgradeOrForceAuth, isSetCookie, isTimedOut, isUrlRewrite, isValidFQDNRequest, isVersionHeaderEnabled, isZeroPageLoginAllowed, newSessionArgExists, parseRequestParameters, persistAMCookie, printCookies, printHash, sendAuthRequestToOrigServer, setCookieVal, setHostUrlCookie, setlbCookie, setRedirectBackServerCookie, setServerCookie, unescapePipe, URLencodedSunQueryParamsString
public static final String BUNDLE_NAME
public static final int REALM
public static final int SERVICE
public static final int MODULE
public static final String FORCE_AUTH
public static InternalSession getSession(AuthContextLocal authContext)
public static AuthContextLocal getAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SessionID sid, boolean isSessionUpgrade, boolean isBackPost) throws AuthException
request
- HTTP Servlet Request.response
- HTTP Servlet Response.sid
- SessionID for this request.isSessionUpgrade
- true
if session upgrade.isBackPost
- true
if back posting.AuthException
public static AuthContextLocal getAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SessionID sessionId, boolean isSessionUpgrade, boolean isBackPost, boolean isLogout, boolean isRestAuth) throws AuthException
request
- HTTP Servlet Request.response
- HTTP Servlet Response.sessionId
- SessionID for this request.isSessionUpgrade
- true
if session upgrade.isBackPost
- true
if back posting.isLogout
- true
for logout.isRestAuth
- true
if the request is coming from JSON REST/XUI.AuthException
public static LoginState getLoginState(AuthContextLocal authContext)
public static javax.servlet.http.Cookie getCookieString(AuthContextLocal ac, String cookieDomain)
ac
- the AuthContext objectcookieDomain
- the cookie domain for creating cookiepublic static javax.servlet.http.Cookie getLogoutCookie(AuthContextLocal ac, String cookieDomain)
ac
- the AuthContextLocal objectcookieDomain
- the cookieDomainpublic static boolean isNewRequest(AuthContextLocal ac)
public static String getLoginSuccessURL(AuthContextLocal authContext)
public static String getLoginFailedURL(AuthContextLocal authContext)
public static String getFileName(AuthContextLocal authContext, String fileName)
public static boolean getInetDomainStatus(AuthContextLocal authContext)
public static boolean newSessionArgExists(Map<String,String> decodedRequestData, SessionID sessionId)
public static String encodeURL(String url, AuthContextLocal authContext)
public static String getLocale(AuthContextLocal authContext)
public static void destroySession(AuthContextLocal authContext)
public static boolean sessionTimedOut(AuthContextLocal authContext)
true
if the session has timed out or the page has
timed out.authContext
- the authentication context object for the request.true
if timed out else false.public static javax.servlet.http.Cookie createlbCookie(AuthContextLocal authContext, String cookieDomain) throws AuthException
AuthException
public static void setlbCookie(AuthContextLocal authContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthException
AuthException
public static int getCompositeAdviceType(AuthContextLocal authContext)
public static AuthContext.IndexType getIndexType(AuthContextLocal authContext)
public static String getIndexName(AuthContextLocal authContext)
public static Callback[] getRecdCallback(AuthContextLocal authContext)
public static String getDefaultFileName(javax.servlet.http.HttpServletRequest request, String fileName)
request
- HTTP Servlet Request.fileName
- name of the filepublic static String getOrgDN(AuthContextLocal authContext)
public static AuthContextLocal getAuthContext(String orgName) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(String orgName, String sessionID) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(String orgName, javax.servlet.http.HttpServletRequest req) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(String orgName, String sessionID, boolean logout) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(javax.servlet.http.HttpServletRequest req, String sessionID) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(String orgName, String sessionID, boolean isLogout, javax.servlet.http.HttpServletRequest req) throws AuthException
orgName
- OrganizationName in requestsessionID
- Session ID for this requestisLogout
- a boolean which is true if it is a Logout requestreq
- HttpServletRequestAuthException
public static AuthContextLocal getAuthContext(String orgName, String sessionID, boolean isLogout, javax.servlet.http.HttpServletRequest req, String indexType, AuthXMLRequest xmlReq) throws AuthException
AuthException
public static AuthContextLocal getAuthContext(String providedOrgName, String sessionID, boolean isLogout, javax.servlet.http.HttpServletRequest req, String indexType, AuthXMLRequest xmlReq, boolean forceAuth) throws AuthException
AuthException
public static Set getAuthModules(int authLevel, String organizationDN, String clientType)
authLevel
- authentication level.organizationDN
- DN for the organization.clientType
- Client type, e.g. "genericHTML".public static InternalSession getOldSession(AuthContextLocal authContext)
public static String getSessionProperty(String property, AuthContextLocal oldAuthContext)
public static boolean isSessionUpgrade(AuthContextLocal authContext)
public static void setCookieSupported(AuthContextLocal ac, boolean flag)
public static boolean isCookieSupported(AuthContextLocal ac)
public static boolean isCookieSet(AuthContextLocal ac)
public static boolean checkForCookies(javax.servlet.http.HttpServletRequest req, AuthContextLocal ac)
req
- HTTP Servlet Request.ac
- authentication context.true
if cookies found in request.public static String getLoginURL(AuthContextLocal authContext)
public static Callback[] getCallbacksPerState(AuthContextLocal authContext, String pageState)
public static void setCallbacksPerState(AuthContextLocal authContext, String pageState, Callback[] callbacks)
public static String getModuleServiceName(String moduleName)
public static String getSuccessURL(javax.servlet.http.HttpServletRequest request, AuthContextLocal authContext)
goto
parameter is
in the current request then returns the goto
parameter
else returns the success URL set in the valid session.request
- HTTP Servlet Request.authContext
- authentication context for this request.public static Map processCompositeAdviceXML(String xmlCompositeAdvice, String orgDN, String clientType)
public static void removeAuthContext(SessionID sid)
public static String getOrgConfiguredAuthenticationChain(String orgDN)
orgDN
- organization DN.public static String getRemoteSecurityEnabled() throws AuthException
AuthException
public static boolean isForwardSuccess(AuthContextLocal authContext, javax.servlet.http.HttpServletRequest req)
authContext
- AuthContextLocal objectreq
- HttpServletRequest objectpublic static boolean forwardSuccessExists(javax.servlet.http.HttpServletRequest req)
true
if the request has the
forward=true
query parameter.req
- HttpServletRequest objecttrue
if this parameter is present.public static Map getGlobalAttributes(String serviceName)
Map
attributesserviceName
- Service NameMap
of global attributes.public static void clearAllCookies(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static void clearAllCookiesByDomain(SessionID sid, String cookieDomain, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static String getPostProcessURL(javax.servlet.http.HttpServletRequest servletRequest, String attrName)
public static void resetPostProcessURLs(javax.servlet.http.HttpServletRequest servletRequest)
public static String getValidGotoURL(javax.servlet.http.HttpServletRequest request, String orgDN)
request
- The HttpServletRequest.orgDN
- Organization DN.public static boolean logout(String sessionID, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SSOException
sessionID
- The token id to logoutrequest
- The HTTP requestresponse
- The HTTP responseSSOException
- If token is null or other SSO exceptionspublic static boolean logout(InternalSession intSession, SSOToken token, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SSOException
intSession
- The InternalSession
to logouttoken
- The SSOToken
to logoutrequest
- The HTTP requestresponse
- The HTTP responseSSOException
- If token is null or other SSO exceptionspublic static ZeroPageLoginConfig getZeroPageLoginConfig(String realm) throws SSOException, SMSException
realm
- the realm to get the ZPL configuration for. Not null.SSOException
- if there is a problem authenticating the configuration lookup.SMSException
- if there is a problem fetching the configuration data.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.