|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.shibboleth.idp.util.HttpServletHelper
public class HttpServletHelper
A helper class that provides access to internal state from Servlets and hence also JSPs.
| Field Summary | |
|---|---|
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 |
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 LoginContexts: "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
LoginContexts 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" . |
| Constructor Summary | |
|---|---|
HttpServletHelper()
|
|
| Method Summary | |
|---|---|
static void |
bindLoginContext(LoginContext loginContext,
javax.servlet.http.HttpServletRequest httpRequest)
Binds a LoginContext to the current request. |
static void |
bindLoginContext(LoginContext loginContext,
org.opensaml.util.storage.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 edu.internet2.middleware.shibboleth.common.attribute.filtering.AttributeFilteringEngine<?> |
getAttributeFilterEnginer(javax.servlet.ServletContext context)
Gets the AttributeFilteringEngine service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.filtering.AttributeFilteringEngine<?> |
getAttributeFilterEnginer(javax.servlet.ServletContext context,
String serviceId)
Gets the AttributeFilteringEngine bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.resolver.AttributeResolver<?> |
getAttributeResolver(javax.servlet.ServletContext context)
Gets the AttributeResolver service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.resolver.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 javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest httpRequest,
String cookieName)
Gets the first Cookie whose name matches the given name. |
static LoginContext |
getLoginContext(javax.servlet.http.HttpServletRequest httpRequest)
Gets the login context from the current request. |
static LoginContext |
getLoginContext(org.opensaml.util.storage.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 edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager |
getRelyingPartyConfirmationManager(javax.servlet.ServletContext context)
Gets the RelyingPartyConfigurationManager service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager |
getRelyingPartyConfirmationManager(javax.servlet.ServletContext context,
String serviceId)
Gets the RelyingPartyConfigurationManager bound to the Servlet context. |
static org.opensaml.saml2.metadata.EntityDescriptor |
getRelyingPartyMetadata(String relyingPartyEntityId,
edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager rpConfigMngr)
Gets the metatdata for a given relying party. |
static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML1AttributeAuthority |
getSAML1AttributeAuthority(javax.servlet.ServletContext context)
Gets the SAML1AttributeAuthority service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML1AttributeAuthority |
getSAML1AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
Gets the SAML1AttributeAuthority bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML2AttributeAuthority |
getSAML2AttributeAuthority(javax.servlet.ServletContext context)
Gets the SAML2AttributeAuthority service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML2AttributeAuthority |
getSAML2AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
Gets the SAML2AttributeAuthority bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.session.SessionManager<Session> |
getSessionManager(javax.servlet.ServletContext context)
Gets the SessionManager service bound to the Servlet context. |
static edu.internet2.middleware.shibboleth.common.session.SessionManager<Session> |
getSessionManager(javax.servlet.ServletContext context,
String serviceId)
Gets the SessionManager bound to the Servlet context. |
static org.opensaml.util.storage.StorageService<?,?> |
getStorageService(javax.servlet.ServletContext context)
Gets the StorageService service bound to the Servlet context. |
static org.opensaml.util.storage.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(org.opensaml.util.storage.StorageService storageService,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Unbinds a LoginContext from the current request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
LoginContexts 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 LoginContexts: "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" .
| Constructor Detail |
|---|
public HttpServletHelper()
| Method Detail |
|---|
public static void bindLoginContext(LoginContext loginContext,
javax.servlet.http.HttpServletRequest httpRequest)
LoginContext to the current request.
loginContext - login context to be boundhttpRequest - current HTTP request
public static void bindLoginContext(LoginContext loginContext,
org.opensaml.util.storage.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 edu.internet2.middleware.shibboleth.common.attribute.filtering.AttributeFilteringEngine<?> getAttributeFilterEnginer(javax.servlet.ServletContext context)
AttributeFilteringEngine service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.attribute.filtering.AttributeFilteringEngine<?> getAttributeFilterEnginer(javax.servlet.ServletContext context,
String serviceId)
AttributeFilteringEngine bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static edu.internet2.middleware.shibboleth.common.attribute.resolver.AttributeResolver<?> getAttributeResolver(javax.servlet.ServletContext context)
AttributeResolver service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.attribute.resolver.AttributeResolver<?> getAttributeResolver(javax.servlet.ServletContext context,
String serviceId)
AttributeResolver bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static String getContextParam(javax.servlet.ServletContext context,
String name,
String defaultValue)
context - the Servlet contextname - name of the context parameterdefaultValue - default value of the parameter
public 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 extracted
public static LoginContext getLoginContext(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest - current HTTP request
public static LoginContext getLoginContext(org.opensaml.util.storage.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 request
public static IdPProfileHandlerManager getProfileHandlerManager(javax.servlet.ServletContext context)
IdPProfileHandlerManager service bound to the Servlet context.
context - the Servlet context
public 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 bound
public static edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager getRelyingPartyConfirmationManager(javax.servlet.ServletContext context)
RelyingPartyConfigurationManager service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager getRelyingPartyConfirmationManager(javax.servlet.ServletContext context,
String serviceId)
RelyingPartyConfigurationManager bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static org.opensaml.saml2.metadata.EntityDescriptor getRelyingPartyMetadata(String relyingPartyEntityId,
edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager rpConfigMngr)
relyingPartyEntityId - the ID of the relying partyrpConfigMngr - relying party configuration manager
public static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML1AttributeAuthority getSAML1AttributeAuthority(javax.servlet.ServletContext context)
SAML1AttributeAuthority service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML1AttributeAuthority getSAML1AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
SAML1AttributeAuthority bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML2AttributeAuthority getSAML2AttributeAuthority(javax.servlet.ServletContext context)
SAML2AttributeAuthority service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.attribute.provider.SAML2AttributeAuthority getSAML2AttributeAuthority(javax.servlet.ServletContext context,
String serviceId)
SAML2AttributeAuthority bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static edu.internet2.middleware.shibboleth.common.session.SessionManager<Session> getSessionManager(javax.servlet.ServletContext context)
SessionManager service bound to the Servlet context.
context - the Servlet context
public static edu.internet2.middleware.shibboleth.common.session.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 bound
public static org.opensaml.util.storage.StorageService<?,?> getStorageService(javax.servlet.ServletContext context)
StorageService service bound to the Servlet context.
context - the Servlet context
public static org.opensaml.util.storage.StorageService<?,?> getStorageService(javax.servlet.ServletContext context,
String serviceId)
StorageService bound to the Servlet context.
context - the Servlet contextserviceId - the ID under which the service bound
public static Session getUserSession(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest - current request
public static LoginContext unbindLoginContext(org.opensaml.util.storage.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 response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||