|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.shibboleth.wayf.DiscoveryServiceHandler
public class DiscoveryServiceHandler
Specific handler for each version of the Discovery Service.
| Field Summary | |
|---|---|
private HandlerConfig |
config
Config handles detailed behavior. |
private static String |
ENTITYID_PARAM_NAME
The SP id. |
private boolean |
isDefault
If isDefault is true then if there is a mismatch then this handler is used. |
private static String |
ISPASSIVE_PARAM_NAME
Whether we are allowed to interact. |
private static String |
KNOWN_POLICY_NAME
The only policy we know about. |
private String |
location
The location defines the last part of the URL which distinguished this handler. |
private static Logger |
LOG
Mandatory Serialization constant. |
private static String |
POLICY_PARAM_NAME
Whether we understand this or not. |
private static String |
PROVIDERID_OBJECT_PARAM_NAME
The entityDescriptor for the SP (if present). |
private static String |
PROVIDERID_PARAM_NAME
This is the ID (in the metadata) of the SP. |
private static String |
RETURN_ATTRIBUTE_NAME
"return" is an invalid attribute, so we use returnX. |
private static String |
RETURN_INDEX_NAME
Alternatively the index of where to send the address back to. |
private static String |
RETURN_PARAM_NAME
Where to send the request back to. |
private static String |
RETURNID_DEFAULT_VALUE
What returnIDParam defaults to. |
private static String |
RETURNID_PARAM_NAME
What value to put the ID of the selected metadata into. |
private static String |
SHIRE_PARAM_NAME
Shire is the SP Assertion Consumer endpoint. |
private List<IdPSiteSet> |
siteSets
The list of all the metadata providers that this discovery handler believes in. |
private static String |
TARGET_PARAM_NAME
TargetName is where we are trying to get to. |
private List<Plugin> |
thePlugins
The list of all the plugins that this hanlder has had configured. |
private static String |
TIME_PARAM_NAME
time is to do with replay attack. |
| Constructor Summary | |
|---|---|
protected |
DiscoveryServiceHandler(Element config,
Map<String,IdPSiteSet> federations,
Map<String,Plugin> plugins,
HandlerConfig defaultConfig)
Constructor to create and configure the handler. |
| Method Summary | |
|---|---|
private void |
checkForSAML2EndPoints(org.opensaml.saml2.metadata.EntityDescriptor sp)
Check for SAML2 endpoints. We have been approached with a DS message. |
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Processes the get request. |
private static boolean |
equalsURL(org.opensaml.samlext.idpdisco.DiscoveryResponse discovery,
URL providedName)
Helper function to see whether the provided endpoint in the metadata matches the provided return URL in the request. |
static void |
forwardRequest(HttpServletRequest req,
HttpServletResponse res,
IdPSite site)
Uses an HTTP Status 307 redirect to forward the user to the IdP or the SP. |
protected String |
getLocation()
The 'Name' of the service. |
private static String |
getSPId(HttpServletRequest req)
Examine the request and return the ID of the service provider by checking Both DS and WAYF protocols. |
private static String |
getValue(HttpServletRequest req,
String name)
Gets the value for the parameter either from the parameter or from jsp. |
private void |
handleError(HttpServletRequest req,
HttpServletResponse res,
String message)
Handles all "recoverable" errors in WAYF processing by logging the error and forwarding the user to an appropriate error page. |
private void |
handleLookup(HttpServletRequest req,
HttpServletResponse res,
String searchName)
Displays a Discovery Service selection page, having first consulted the plugins as needed. |
private void |
handleSelection(HttpServletRequest req,
HttpServletResponse res)
When the WAYF user has selected something we look it up, tell the plugins and then dispatch to the Idp. |
protected boolean |
isDefault()
Whether this is the default service. |
private void |
policePolicyType(HttpServletRequest req,
HttpServletResponse res)
Make sure that the policy is provides and is of the correct type. |
private void |
setDisplayLanguage(Collection<IdPSite> sites,
HttpServletRequest req)
Prior to display we set the display language from the browser. |
private void |
setupReturnAddress(String spName,
HttpServletRequest req)
This sets up the parameter RETURN_ATTRIBUTE_NAME with the return address harvested from the reqest. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String SHIRE_PARAM_NAME
private static final String TARGET_PARAM_NAME
private static final String TIME_PARAM_NAME
private static final String PROVIDERID_PARAM_NAME
private static final String PROVIDERID_OBJECT_PARAM_NAME
private static final String ENTITYID_PARAM_NAME
private static final String RETURN_PARAM_NAME
private static final String RETURN_ATTRIBUTE_NAME
private static final String RETURN_INDEX_NAME
private static final String RETURNID_PARAM_NAME
private static final String RETURNID_DEFAULT_VALUE
private static final String ISPASSIVE_PARAM_NAME
private static final String POLICY_PARAM_NAME
private static final String KNOWN_POLICY_NAME
private static final Logger LOG
private final String location
private final boolean isDefault
private final HandlerConfig config
private final List<IdPSiteSet> siteSets
private final List<Plugin> thePlugins
| Constructor Detail |
|---|
protected DiscoveryServiceHandler(Element config,
Map<String,IdPSiteSet> federations,
Map<String,Plugin> plugins,
HandlerConfig defaultConfig)
throws ShibbolethConfigurationException
config - - DOM Element with configuration information.federations - - Supplies all known providers which will be included if so configured.plugins - - Supplies all known plugins which will be included if configured in.defaultConfig - - The default configurations.
ShibbolethConfigurationException - - if we find something odd in the config file.| Method Detail |
|---|
protected String getLocation()
protected boolean isDefault()
private void policePolicyType(HttpServletRequest req,
HttpServletResponse res)
req - the request.res - the response.
public void doGet(HttpServletRequest req,
HttpServletResponse res)
req - current HTTP requestres - current HTTP response
private void handleSelection(HttpServletRequest req,
HttpServletResponse res)
throws WayfRequestHandled,
WayfException
req - - standard J2EE stuffres - - standard J2EE stuff
WayfRequestHandled - - if one of the plugins has done the dispatch
WayfException - - if we had an errors
private void setupReturnAddress(String spName,
HttpServletRequest req)
throws WayfException
spName - - the name of the Service provider.req - - The request.
WayfException - - if we spot spoofing or there is no defaumlt
private static boolean equalsURL(org.opensaml.samlext.idpdisco.DiscoveryResponse discovery,
URL providedName)
discovery - providedName -
private void handleLookup(HttpServletRequest req,
HttpServletResponse res,
String searchName)
throws WayfException,
WayfRequestHandled
req - Describes the requestres - Describes the responsesearchName - What are we looking for?
WayfRequestHandled - if a plugin has dealt with the request
WayfException - in case of an error.private void checkForSAML2EndPoints(org.opensaml.saml2.metadata.EntityDescriptor sp)
sp - the EntityDescript of an SP which has asked for DS protocol.
private void setDisplayLanguage(Collection<IdPSite> sites,
HttpServletRequest req)
sites - - the sites we need to impactreq - - from which we get the locale
public static void forwardRequest(HttpServletRequest req,
HttpServletResponse res,
IdPSite site)
throws WayfException
req - request under considerationres - response under constructionsite - The Idp
WayfException - if bad things happen.
private void handleError(HttpServletRequest req,
HttpServletResponse res,
String message)
req - request under considerationres - response under constructionmessage - - what so say
private static String getValue(HttpServletRequest req,
String name)
req - - the request.name - - the name of the parameter.
private static String getSPId(HttpServletRequest req)
throws WayfException
req - the request.
WayfException - if no SP ID was found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||