public class HttpServletHelper extends Object
修飾子とタイプ | フィールドと説明 |
---|---|
static String |
ATTRIBUTE_FILTER_ENGINE_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the AttributeFilteringEngine service: "AttributeFilterEngineId" . |
static String |
ATTRIBUTE_RESOLVER_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the AttributeResolver service: "AttributeResolverId" . |
static String |
COOKIE_DOMAIN_PARAM
Name of the context initialization parameter that stores the domain to use for all cookies.
|
static String |
DEFAULT_ATTRIBUTE_FILTER_ENGINE_SID
Default ID by which the
AttributeFilteringEngine is know within the Servlet context: "shibboleth.AttributeFilterEngine" . |
static String |
DEFAULT_ATTRIBUTE_RESOLVER_SID
Default ID by which the
AttributeResolver is know within the Servlet context: "shibboleth.AttributeResolver" . |
static String |
DEFAULT_LOGIN_CTX_PARITION
Default name for the
StorageService partition which holds LoginContext s: "loginContexts" . |
static String |
DEFAULT_PROFILE_HANDLER_MNGR_SID
Default ID by which the
IdPProfileHandlerManager is know within the Servlet context: "shibboleth.HandlerManager" . |
static String |
DEFAULT_RP_CONFIG_MNGR_SID
Default ID by which the
RelyingPartyConfigurationManager is know within the Servlet context: "shibboleth.RelyingPartyConfigurationManager" . |
static String |
DEFAULT_SAML1_AA_SID
Default ID by which the
SAML1AttributeAuthority is know within the Servlet context: "shibboleth.SAML1AttributeAuthority" . |
static String |
DEFAULT_SAML2_AA_SID
Default ID by which the
SAML2AttributeAuthority is know within the Servlet context: "shibboleth.SAML2AttributeAuthority" . |
static String |
DEFAULT_SESSION_MNGR_SID
Default ID by which the
SessionManager is know within the Servlet context: "shibboleth.SessionManager" . |
static String |
DEFAULT_STORAGE_SERVICE_SID
Default ID by which the
StorageService is know within the Servlet context: "shibboleth.StorageService" . |
static String |
IDP_SESSION_COOKIE
Name of the cookie containing the IdP session ID: "_idp_session" .
|
static String |
LOGIN_CTX_KEY_NAME
Name of the key to the current authentication login context: "_idp_authn_lc_key" .
|
static String |
LOGIN_CTX_PARTITION_CTX_PARAM
ServletContext parameter name bearing the name of the StorageService partition into which
LoginContext s are stored: "loginContextPartitionName" . |
static String |
PROFILE_HANDLER_MNGR_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the IdPProfileHandlerManager service: "ProfileHandlerMngrId" . |
static String |
RP_CONFIG_MNGR_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the RelyingPartyConfigurationManager service: * *
* "RelyingPartyConfigurationManagerId" . |
static String |
SAML1_AA_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the SAML1AttributeAuthority service: "SAML1AttributeAuthorityId" . |
static String |
SAML2_AA_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the SAML2AttributeAuthority service: "SAML2AttributeAuthorityId" . |
static String |
SESSION_MNGR_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the SessionManager service: "SessionManagerId" . |
static String |
STORAGE_SERVICE_SID_CTX_PARAM
ServletContext parameter name bearing the ID of the SAML1AttributeAuthority service: "StorageServiceId" . |
コンストラクタと説明 |
---|
HttpServletHelper() |
修飾子とタイプ | メソッドと説明 |
---|---|
static void |
bindLoginContext(LoginContext loginContext,
javax.servlet.http.HttpServletRequest httpRequest)
推奨されていません。
|
static void |
bindLoginContext(LoginContext loginContext,
StorageService storageService,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Binds a
LoginContext to the issuer of the current request. |
static AttributeFilteringEngine<?> |
getAttributeFilterEnginer(javax.servlet.ServletContext context)
Gets the
AttributeFilteringEngine service bound to the Servlet context. |
static AttributeFilteringEngine<?> |
getAttributeFilterEnginer(javax.servlet.ServletContext context,
String serviceId)
Gets the
AttributeFilteringEngine bound to the Servlet context. |
static AttributeResolver<?> |
getAttributeResolver(javax.servlet.ServletContext context)
Gets the
AttributeResolver service bound to the Servlet context. |
static AttributeResolver<?> |
getAttributeResolver(javax.servlet.ServletContext context,
String serviceId)
Gets the
AttributeResolver bound to the Servlet context. |
static String |
getContextParam(javax.servlet.ServletContext context,
String name,
String defaultValue)
Gets a value for a given context parameter.
|
static URLBuilder |
getContextRelativeUrl(javax.servlet.http.HttpServletRequest httpRequest,
String path)
Builds a URL to a path that is meant to be relative to the Servlet context.
|
static javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest httpRequest,
String cookieName)
Gets the first
Cookie whose name matches the given name. |
static String |
getCookieDomain(javax.servlet.ServletContext context)
Gets the domain to use for all cookies.
|
static LoginContext |
getLoginContext(javax.servlet.http.HttpServletRequest httpRequest)
推奨されていません。
|
static LoginContext |
getLoginContext(StorageService storageService,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest httpRequest)
Gets the
LoginContext for the user issuing the HTTP request. |
static IdPProfileHandlerManager |
getProfileHandlerManager(javax.servlet.ServletContext context)
Gets the
IdPProfileHandlerManager service bound to the Servlet context. |
static IdPProfileHandlerManager |
getProfileHandlerManager(javax.servlet.ServletContext context,
String serviceId)
Gets the
IdPProfileHandlerManager bound to the Servlet context. |
static RelyingPartyConfigurationManager |
getRelyingPartyConfigurationManager(javax.servlet.ServletContext context)
Gets the
RelyingPartyConfigurationManager service bound to the Servlet context. |
static RelyingPartyConfigurationManager |
getRelyingPartyConfigurationManager(javax.servlet.ServletContext context,
String serviceId)
Gets the
RelyingPartyConfigurationManager bound to the Servlet context. |
static RelyingPartyConfigurationManager |
getRelyingPartyConfirmationManager(javax.servlet.ServletContext context)
推奨されていません。
|
static RelyingPartyConfigurationManager |
getRelyingPartyConfirmationManager(javax.servlet.ServletContext context,
String serviceId)
推奨されていません。
|
static EntityDescriptor |
getRelyingPartyMetadata(String relyingPartyEntityId,
RelyingPartyConfigurationManager rpConfigMngr)
Gets the metatdata for a given relying party.
|
static SAML1AttributeAuthority |
getSAML1AttributeAuthority(javax.servlet.ServletContext context)
Gets the
SAML1AttributeAuthority service bound to the Servlet context. |
static SAML1AttributeAuthority |
getSAML1AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
Gets the
SAML1AttributeAuthority bound to the Servlet context. |
static SAML2AttributeAuthority |
getSAML2AttributeAuthority(javax.servlet.ServletContext context)
Gets the
SAML2AttributeAuthority service bound to the Servlet context. |
static SAML2AttributeAuthority |
getSAML2AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
Gets the
SAML2AttributeAuthority bound to the Servlet context. |
static URLBuilder |
getServletContextUrl(javax.servlet.http.HttpServletRequest httpRequest)
Builds a URL, up to and including the servlet context path.
|
static SessionManager<Session> |
getSessionManager(javax.servlet.ServletContext context)
Gets the
SessionManager service bound to the Servlet context. |
static SessionManager<Session> |
getSessionManager(javax.servlet.ServletContext context,
String serviceId)
Gets the
SessionManager bound to the Servlet context. |
static StorageService<?,?> |
getStorageService(javax.servlet.ServletContext context)
Gets the
StorageService service bound to the Servlet context. |
static StorageService<?,?> |
getStorageService(javax.servlet.ServletContext context,
String serviceId)
Gets the
StorageService bound to the Servlet context. |
static Session |
getUserSession(javax.servlet.http.HttpServletRequest httpRequest)
Gets the user session from the request.
|
static LoginContext |
unbindLoginContext(StorageService storageService,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Unbinds a
LoginContext from the current request. |
public static final String COOKIE_DOMAIN_PARAM
public static final String IDP_SESSION_COOKIE
public static final String LOGIN_CTX_KEY_NAME
public static final String ATTRIBUTE_FILTER_ENGINE_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the AttributeFilteringEngine
service: "AttributeFilterEngineId" .public static final String ATTRIBUTE_RESOLVER_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the AttributeResolver
service: "AttributeResolverId" .public static final String LOGIN_CTX_PARTITION_CTX_PARAM
ServletContext
parameter name bearing the name of the StorageService
partition into which
LoginContext
s are stored: "loginContextPartitionName" .public static final String PROFILE_HANDLER_MNGR_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the IdPProfileHandlerManager
service: "ProfileHandlerMngrId" .public static final String RP_CONFIG_MNGR_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the RelyingPartyConfigurationManager
service: * *
* "RelyingPartyConfigurationManagerId" .public static final String SAML1_AA_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the SAML1AttributeAuthority
service: "SAML1AttributeAuthorityId" .public static final String SAML2_AA_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the SAML2AttributeAuthority
service: "SAML2AttributeAuthorityId" .public static final String SESSION_MNGR_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the SessionManager
service: "SessionManagerId" .public static final String STORAGE_SERVICE_SID_CTX_PARAM
ServletContext
parameter name bearing the ID of the SAML1AttributeAuthority
service: "StorageServiceId" .public static final String DEFAULT_ATTRIBUTE_FILTER_ENGINE_SID
AttributeFilteringEngine
is know within the Servlet context: "shibboleth.AttributeFilterEngine" .public static final String DEFAULT_ATTRIBUTE_RESOLVER_SID
AttributeResolver
is know within the Servlet context: "shibboleth.AttributeResolver" .public static final String DEFAULT_LOGIN_CTX_PARITION
StorageService
partition which holds LoginContext
s: "loginContexts" .public static final String DEFAULT_PROFILE_HANDLER_MNGR_SID
IdPProfileHandlerManager
is know within the Servlet context: "shibboleth.HandlerManager" .public static final String DEFAULT_RP_CONFIG_MNGR_SID
RelyingPartyConfigurationManager
is know within the Servlet context: "shibboleth.RelyingPartyConfigurationManager" .public static final String DEFAULT_SAML1_AA_SID
SAML1AttributeAuthority
is know within the Servlet context: "shibboleth.SAML1AttributeAuthority" .public static final String DEFAULT_SAML2_AA_SID
SAML2AttributeAuthority
is know within the Servlet context: "shibboleth.SAML2AttributeAuthority" .public static final String DEFAULT_SESSION_MNGR_SID
SessionManager
is know within the Servlet context: "shibboleth.SessionManager" .public static final String DEFAULT_STORAGE_SERVICE_SID
StorageService
is know within the Servlet context: "shibboleth.StorageService" .public static void bindLoginContext(LoginContext loginContext, javax.servlet.http.HttpServletRequest httpRequest)
LoginContext
to the current request.loginContext
- login context to be boundhttpRequest
- current HTTP requestpublic static void bindLoginContext(LoginContext loginContext, StorageService storageService, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
LoginContext
to the issuer of the current request. The binding is done by creating a random UUID,
placing that in a cookie in the request, and storing the context in to the storage service under that key.loginContext
- the login context to be boundstorageService
- the storage service which will hold the contextcontext
- the Servlet contexthttpRequest
- the current HTTP requesthttpResponse
- the current HTTP responsepublic static String getCookieDomain(javax.servlet.ServletContext context)
context
- web application contextpublic static AttributeFilteringEngine<?> getAttributeFilterEnginer(javax.servlet.ServletContext context)
AttributeFilteringEngine
service bound to the Servlet context.context
- the Servlet contextpublic static AttributeFilteringEngine<?> getAttributeFilterEnginer(javax.servlet.ServletContext context, String serviceId)
AttributeFilteringEngine
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static AttributeResolver<?> getAttributeResolver(javax.servlet.ServletContext context)
AttributeResolver
service bound to the Servlet context.context
- the Servlet contextpublic static AttributeResolver<?> getAttributeResolver(javax.servlet.ServletContext context, String serviceId)
AttributeResolver
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static String getContextParam(javax.servlet.ServletContext context, String name, String defaultValue)
context
- the Servlet contextname
- name of the context parameterdefaultValue
- default value of the parameterpublic static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest httpRequest, String cookieName)
Cookie
whose name matches the given name.cookieName
- the cookie namehttpRequest
- HTTP request from which the cookie should be extractedpublic static LoginContext getLoginContext(javax.servlet.http.HttpServletRequest httpRequest)
getLoginContext(StorageService, ServletContext, HttpServletRequest)
insteadgetLoginContext(StorageService, ServletContext, HttpServletRequest)
.httpRequest
- current HTTP requestpublic static LoginContext getLoginContext(StorageService storageService, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest httpRequest)
LoginContext
for the user issuing the HTTP request. Note, login contexts are only available
during the authentication process.context
- the Servlet contextstorageService
- storage service to use when retrieving the login contexthttpRequest
- current HTTP requestpublic static IdPProfileHandlerManager getProfileHandlerManager(javax.servlet.ServletContext context)
IdPProfileHandlerManager
service bound to the Servlet context.context
- the Servlet contextpublic static IdPProfileHandlerManager getProfileHandlerManager(javax.servlet.ServletContext context, String serviceId)
IdPProfileHandlerManager
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static RelyingPartyConfigurationManager getRelyingPartyConfigurationManager(javax.servlet.ServletContext context)
RelyingPartyConfigurationManager
service bound to the Servlet context.context
- the Servlet contextpublic static RelyingPartyConfigurationManager getRelyingPartyConfigurationManager(javax.servlet.ServletContext context, String serviceId)
RelyingPartyConfigurationManager
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static RelyingPartyConfigurationManager getRelyingPartyConfirmationManager(javax.servlet.ServletContext context)
getRelyingPartyConfigurationManager(ServletContext)
RelyingPartyConfigurationManager
service bound to the Servlet context.context
- the Servlet contextpublic static RelyingPartyConfigurationManager getRelyingPartyConfirmationManager(javax.servlet.ServletContext context, String serviceId)
getRelyingPartyConfigurationManager(ServletContext, String)
RelyingPartyConfigurationManager
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static EntityDescriptor getRelyingPartyMetadata(String relyingPartyEntityId, RelyingPartyConfigurationManager rpConfigMngr)
relyingPartyEntityId
- the ID of the relying partyrpConfigMngr
- relying party configuration managerpublic static SAML1AttributeAuthority getSAML1AttributeAuthority(javax.servlet.ServletContext context)
SAML1AttributeAuthority
service bound to the Servlet context.context
- the Servlet contextpublic static SAML1AttributeAuthority getSAML1AttributeAuthority(javax.servlet.ServletContext context, String serviceId)
SAML1AttributeAuthority
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static SAML2AttributeAuthority getSAML2AttributeAuthority(javax.servlet.ServletContext context)
SAML2AttributeAuthority
service bound to the Servlet context.context
- the Servlet contextpublic static SAML2AttributeAuthority getSAML2AttributeAuthority(javax.servlet.ServletContext context, String serviceId)
SAML2AttributeAuthority
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static SessionManager<Session> getSessionManager(javax.servlet.ServletContext context)
SessionManager
service bound to the Servlet context.context
- the Servlet contextpublic static SessionManager<Session> getSessionManager(javax.servlet.ServletContext context, String serviceId)
SessionManager
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static StorageService<?,?> getStorageService(javax.servlet.ServletContext context)
StorageService
service bound to the Servlet context.context
- the Servlet contextpublic static StorageService<?,?> getStorageService(javax.servlet.ServletContext context, String serviceId)
StorageService
bound to the Servlet context.context
- the Servlet contextserviceId
- the ID under which the service boundpublic static Session getUserSession(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest
- current requestpublic static LoginContext unbindLoginContext(StorageService storageService, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
LoginContext
from the current request. The unbinding results in the destruction of the
associated context key cookie and removes the context from the storage service.storageService
- storage service holding the contextcontext
- the Servlet contexthttpRequest
- current HTTP requesthttpResponse
- current HTTP responsepublic static URLBuilder getServletContextUrl(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest
- httpRequest made to the servlet in questionpublic static URLBuilder getContextRelativeUrl(javax.servlet.http.HttpServletRequest httpRequest, String path)
httpRequest
- current HTTP requestpath
- path relative to the context, may start with a "/"Copyright © 2012. All Rights Reserved.