|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.shibboleth.wayf.plugins.provider.SamlCookiePlugin
public class SamlCookiePlugin
This is a test implementation of the _SAML_IDP cookie lookup stuff to see whether it fits the plugin architecture.
| Nested Class Summary | |
|---|---|
private static class |
SamlCookiePlugin.Context
This is just a marker tag. |
class |
SamlCookiePlugin.SamlIdPCookie
Class to abstract away the saml cookie for us. |
| Field Summary | |
|---|---|
private boolean |
alwaysFollow
Do we always go where the cookie tells us, or do we just provide the cookie as a hint. |
private String |
cacheDomain
Lipservice towards having a common domain cookie. |
private int |
cacheExpiration
How long the cookie our will be active? |
private static String |
COOKIE_NAME
As specified in the SAML2 profiles specification. |
private static int |
DEFAULT_CACHE_EXPIRATION
By default we keep the cookie around for a week. |
private boolean |
deleteCookie
Is our job to clean up the cookie. |
private static Logger |
log
Handle for logging. |
private static String |
PARAMETER_NAME
The parameter which controls the cache. |
private static String |
PARAMETER_PERM
Parameter to say make it last a long time. |
private static String |
PARAMETER_SESSION
Parameter to say just keep this as long as the browser is open. |
| Constructor Summary | |
|---|---|
private |
SamlCookiePlugin()
Create a plugin with the hard-wired default settings. |
|
SamlCookiePlugin(Element element)
This constructor is called during wayf initialization with it's own little bit of XML config. |
| Method Summary | |
|---|---|
private static void |
deleteCookie(HttpServletRequest req,
HttpServletResponse res)
Delete the cookie from the response. |
private static Cookie |
getCookie(HttpServletRequest req)
Extract the cookie from a request. |
private SamlCookiePlugin.SamlIdPCookie |
getIdPCookie(HttpServletRequest req,
HttpServletResponse res,
String domain)
Load up the cookie and convert it into a SamlIdPCookie. |
PluginContext |
lookup(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
Map<String,IdPSite> validIdps,
PluginContext context,
List<IdPSite> idpList)
This is the 'hook' in the lookup part of Discovery Service processing. |
PluginMetadataParameter |
refreshMetadata(org.opensaml.saml2.metadata.provider.MetadataProvider metadata)
Plugin point which is called when the data is refreshed. |
PluginContext |
search(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
String pattern,
Map<String,IdPSite> validIdps,
PluginContext context,
Collection<IdPSite> searchResult,
List<IdPSite> idpList)
Plugin point for searching. |
void |
selected(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
String idP)
Plugin point for selection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String PARAMETER_NAME
private static final String PARAMETER_PERM
private static final String PARAMETER_SESSION
private static Logger log
private static final String COOKIE_NAME
private static final int DEFAULT_CACHE_EXPIRATION
private boolean alwaysFollow
private boolean deleteCookie
private final String cacheDomain
private int cacheExpiration
| Constructor Detail |
|---|
public SamlCookiePlugin(Element element)
element - - further information to be gleaned from the DOM.private SamlCookiePlugin()
| Method Detail |
|---|
public PluginContext lookup(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
Map<String,IdPSite> validIdps,
PluginContext context,
List<IdPSite> idpList)
throws WayfRequestHandled
lookup in interface Pluginreq - - Describes the current request. Used to find any appropriate cookiesres - - Describes the current response. Used to redirect the request.parameter - - Describes the metadata.context - - Any processing context returned from a previous call. We set this on first call and use non null
to indicate that we don't go there again.validIdps - The list of IdPs which is currently views as possibly matches for the pattern. The Key is the
EntityId for the IdP and the value the object which describes the IdpidpList - The set of Idps which are currently considered as potential hints.
WayfRequestHandled - if the plugin has handled the request. issues a redirect)Plugin.lookup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, edu.internet2.middleware.shibboleth.wayf.plugins.PluginMetadataParameter, java.util.Map, edu.internet2.middleware.shibboleth.wayf.plugins.PluginContext, java.util.List) public PluginMetadataParameter refreshMetadata(org.opensaml.saml2.metadata.provider.MetadataProvider metadata)
refreshMetadata in interface Pluginmetadata - - where to get the data from.
Plugin.refreshMetadata(org.opensaml.saml2.metadata.provider.MetadataProvider)
public PluginContext search(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
String pattern,
Map<String,IdPSite> validIdps,
PluginContext context,
Collection<IdPSite> searchResult,
List<IdPSite> idpList)
throws WayfRequestHandled
search in interface Pluginreq - Describes the current request.res - Describes the current response.parameter - Describes the metadata.pattern - What we are searchign for.validIdps - The list of IdPs which is currently views as possibly matches for the pattern. The Key is the
EntityId for the IdP and the value the object which describes the Idpcontext - Any processing context returned from a previous call. We set this on first call and use non null
to indicate that we don't go there again.searchResult - What the search yielded.idpList - The set of Idps which are currently considered as potential hints.
WayfRequestHandled
WayfRequestHandled - if the plugin has handled the request.Plugin.search(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, edu.internet2.middleware.shibboleth.wayf.plugins.PluginMetadataParameter, java.lang.String, java.util.Map, edu.internet2.middleware.shibboleth.wayf.plugins.PluginContext, java.util.Collection, java.util.List)
public void selected(HttpServletRequest req,
HttpServletResponse res,
PluginMetadataParameter parameter,
String idP)
selected in interface Pluginreq - Describes the current request.res - Describes the current response.parameter - Describes the metadata.idP - Describes the idp.Plugin.selected(HttpServletRequest, HttpServletResponse, PluginMetadataParameter, String)private static Cookie getCookie(HttpServletRequest req)
req - the request.
private static void deleteCookie(HttpServletRequest req,
HttpServletResponse res)
req - The request.res - The response.
private SamlCookiePlugin.SamlIdPCookie getIdPCookie(HttpServletRequest req,
HttpServletResponse res,
String domain)
req - The request.res - The response.domain - - if this is set then any created cookies are set to this domain
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||