Rationalized signing support. Profile requirements, Relying Party configs, and SAML...
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / common / ServiceProviderMapper.java
1 /*
2  * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
3  * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
4  * provided that the following conditions are met: Redistributions of source code must retain the above copyright
5  * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
6  * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
7  * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
8  * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
9  * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
10  * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
11  * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
12  * products derived from this software without specific prior written permission. For written permission, please contact
13  * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
14  * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
15  * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
16  * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
18  * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
19  * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 package edu.internet2.middleware.shibboleth.common;
27
28 import java.net.MalformedURLException;
29 import java.net.URI;
30 import java.net.URISyntaxException;
31 import java.net.URL;
32 import java.util.HashMap;
33 import java.util.Map;
34
35 import org.apache.log4j.Logger;
36 import org.w3c.dom.Element;
37 import org.w3c.dom.NodeList;
38
39 import edu.internet2.middleware.shibboleth.idp.IdPConfig;
40 import edu.internet2.middleware.shibboleth.metadata.EntitiesDescriptor;
41 import edu.internet2.middleware.shibboleth.metadata.Metadata;
42 import edu.internet2.middleware.shibboleth.metadata.EntityDescriptor;
43
44 /**
45  * Class for determining the effective relying party from the unique id of the service provider. Checks first for an
46  * exact match on the service provider, then for membership in a federation. Uses the default relying party if neither
47  * is found.
48  * 
49  * @author Walter Hoehn
50  */
51 public class ServiceProviderMapper {
52
53         private static Logger log = Logger.getLogger(ServiceProviderMapper.class.getName());
54         protected Map relyingParties = new HashMap();
55         private Metadata metaData;
56         private IdPConfig configuration;
57         private Credentials credentials;
58         private NameMapper nameMapper;
59
60         public ServiceProviderMapper(Element rawConfig, IdPConfig configuration, Credentials credentials,
61                         NameMapper nameMapper) throws ServiceProviderMapperException {
62
63                 this.configuration = configuration;
64                 this.credentials = credentials;
65                 this.nameMapper = nameMapper;
66
67                 NodeList itemElements = rawConfig.getElementsByTagNameNS(IdPConfig.configNameSpace, "RelyingParty");
68
69                 for (int i = 0; i < itemElements.getLength(); i++) {
70                         addRelyingParty((Element) itemElements.item(i));
71                 }
72
73                 verifyDefaultParty(configuration);
74
75         }
76
77         public void setMetadata(Metadata metadata) {
78
79                 this.metaData = metadata;
80         }
81
82         private IdPConfig getOriginConfig() {
83
84                 return configuration;
85         }
86
87         protected void verifyDefaultParty(IdPConfig configuration) throws ServiceProviderMapperException {
88
89                 // Verify we have a proper default party
90                 String defaultParty = configuration.getDefaultRelyingPartyName();
91                 if (defaultParty == null || defaultParty.equals("")) {
92                         if (relyingParties.size() != 1) {
93                                 log
94                                                 .error("Default Relying Party not specified.  Add a (defaultRelyingParty) attribute to <IdPConfig>.");
95                                 throw new ServiceProviderMapperException("Required configuration not specified.");
96                         } else {
97                                 log.debug("Only one Relying Party loaded.  Using this as the default.");
98                         }
99                 }
100                 log.debug("Default Relying Party set to: (" + defaultParty + ").");
101                 if (!relyingParties.containsKey(defaultParty)) {
102                         log.error("Default Relying Party refers to a Relying Party that has not been loaded.");
103                         throw new ServiceProviderMapperException("Invalid configuration (Default Relying Party).");
104                 }
105         }
106
107         protected RelyingParty getRelyingPartyImpl(String providerIdFromTarget) {
108
109                 // Null request, send the default
110                 if (providerIdFromTarget == null) {
111                         RelyingParty relyingParty = getDefaultRelyingParty();
112                         log.info("Using default Relying Party: (" + relyingParty.getName() + ").");
113                         return new UnknownProviderWrapper(relyingParty, providerIdFromTarget);
114                 }
115
116                 // Look for a configuration for the specific relying party
117                 if (relyingParties.containsKey(providerIdFromTarget)) {
118                         log.info("Found Relying Party for (" + providerIdFromTarget + ").");
119                         return (RelyingParty) relyingParties.get(providerIdFromTarget);
120                 }
121
122                 // Next, check to see if the relying party is in any groups
123                 RelyingParty groupParty = findRelyingPartyByGroup(providerIdFromTarget);
124                 if (groupParty != null) {
125                         log.info("Provider is a member of Relying Party (" + groupParty.getName() + ").");
126                         return new RelyingPartyGroupWrapper(groupParty, providerIdFromTarget);
127                 }
128
129                 // OK, we can't find it... just send the default
130                 RelyingParty relyingParty = getDefaultRelyingParty();
131                 log.info("Could not locate Relying Party configuration for (" + providerIdFromTarget
132                                 + ").  Using default Relying Party: (" + relyingParty.getName() + ").");
133                 return new UnknownProviderWrapper(relyingParty, providerIdFromTarget);
134         }
135
136         private RelyingParty findRelyingPartyByGroup(String providerIdFromTarget) {
137
138                 if (metaData == null) { return null; }
139
140                 EntityDescriptor provider = metaData.lookup(providerIdFromTarget);
141                 if (provider != null) {
142                         EntitiesDescriptor parent = provider.getEntitiesDescriptor();
143                         while (parent != null) {
144                                 if (relyingParties.containsKey(parent.getName())) {
145                                         log.info("Found matching Relying Party for group (" + parent.getName() + ").");
146                                         return (RelyingParty) relyingParties.get(parent.getName());
147                                 } else {
148                                         log.debug("Provider is a member of group (" + parent.getName()
149                                                         + "), but no matching Relying Party was found.");
150                                 }
151                                 parent = parent.getEntitiesDescriptor();
152                         }
153                 }
154                 return null;
155         }
156
157         public RelyingParty getDefaultRelyingParty() {
158
159                 // If there is no explicit default, pick the single configured Relying
160                 // Party
161                 String defaultParty = getOriginConfig().getDefaultRelyingPartyName();
162                 if (defaultParty == null || defaultParty.equals("")) { return (RelyingParty) relyingParties.values().iterator()
163                                 .next(); }
164
165                 // If we do have a default specified, use it...
166                 return (RelyingParty) relyingParties.get(defaultParty);
167         }
168
169         /**
170          * Returns the relying party for a legacy provider(the default)
171          */
172         public RelyingParty getLegacyRelyingParty() {
173
174                 RelyingParty relyingParty = getDefaultRelyingParty();
175                 log.info("Request is from legacy shib target.  Selecting default Relying Party: (" + relyingParty.getName()
176                                 + ").");
177                 return new LegacyWrapper((RelyingParty) relyingParty);
178
179         }
180
181         /**
182          * Returns the appropriate relying party for the supplied service provider id.
183          */
184         public RelyingParty getRelyingParty(String providerIdFromTarget) {
185
186                 if (providerIdFromTarget == null || providerIdFromTarget.equals("")) {
187                         RelyingParty relyingParty = getDefaultRelyingParty();
188                         log.info("Selecting default Relying Party: (" + relyingParty.getName() + ").");
189                         return new NoMetadataWrapper((RelyingParty) relyingParty);
190                 }
191
192                 return (RelyingParty) getRelyingPartyImpl(providerIdFromTarget);
193         }
194
195         private void addRelyingParty(Element e) throws ServiceProviderMapperException {
196
197                 log.debug("Found a Relying Party.");
198                 try {
199                         if (e.getLocalName().equals("RelyingParty")) {
200                                 RelyingParty party = new RelyingPartyImpl(e, configuration, credentials, nameMapper);
201                                 log.debug("Relying Party (" + party.getName() + ") loaded.");
202                                 relyingParties.put(party.getName(), party);
203                         }
204                 } catch (ServiceProviderMapperException exc) {
205                         log.error("Encountered an error while attempting to load Relying Party configuration.  Skipping...");
206                 }
207
208         }
209
210         /**
211          * Base relying party implementation.
212          * 
213          * @author Walter Hoehn
214          */
215         protected class RelyingPartyImpl implements RelyingParty {
216
217                 private RelyingPartyIdentityProvider identityProvider;
218                 private String name;
219                 private String overridenOriginProviderId;
220                 private URL overridenAAUrl;
221                 private URI overridenDefaultAuthMethod;
222                 private String hsNameFormatId;
223                 private IdPConfig configuration;
224                 private boolean overridenPassThruErrors = false;
225                 private boolean passThruIsOverriden = false;
226                 private boolean forceAttributePush = false;
227                 private boolean forceAttributeNoPush = false;
228                 private boolean defaultToPOST = true;
229                 private boolean wantsAssertionsSigned = false;
230
231                 public RelyingPartyImpl(Element partyConfig, IdPConfig globalConfig, Credentials credentials,
232                                 NameMapper nameMapper) throws ServiceProviderMapperException {
233
234                         configuration = globalConfig;
235
236                         // Get party name
237                         name = ((Element) partyConfig).getAttribute("name");
238                         if (name == null || name.equals("")) {
239                                 log.error("Relying Party name not set.  Add a (name) attribute to <RelyingParty>.");
240                                 throw new ServiceProviderMapperException("Required configuration not specified.");
241                         }
242                         log.debug("Loading Relying Party: (" + name + ").");
243
244                         // Process overrides for global configuration data
245                         String attribute = ((Element) partyConfig).getAttribute("providerId");
246                         if (attribute != null && !attribute.equals("")) {
247                                 log.debug("Overriding providerId for Relying Pary (" + name + ") with (" + attribute + ").");
248                                 overridenOriginProviderId = attribute;
249                         }
250
251                         attribute = ((Element) partyConfig).getAttribute("AAUrl");
252                         if (attribute != null && !attribute.equals("")) {
253                                 log.debug("Overriding AAUrl for Relying Pary (" + name + ") with (" + attribute + ").");
254                                 try {
255                                         overridenAAUrl = new URL(attribute);
256                                 } catch (MalformedURLException e) {
257                                         log.error("(AAUrl) attribute to is not a valid URL.");
258                                         throw new ServiceProviderMapperException("Configuration is invalid.");
259                                 }
260                         }
261
262                         attribute = ((Element) partyConfig).getAttribute("defaultAuthMethod");
263                         if (attribute != null && !attribute.equals("")) {
264                                 log.debug("Overriding defaultAuthMethod for Relying Pary (" + name + ") with (" + attribute + ").");
265                                 try {
266                                         overridenDefaultAuthMethod = new URI(attribute);
267                                 } catch (URISyntaxException e1) {
268                                         log.error("(defaultAuthMethod) attribute to is not a valid URI.");
269                                         throw new ServiceProviderMapperException("Configuration is invalid.");
270                                 }
271                         }
272
273                         attribute = ((Element) partyConfig).getAttribute("passThruErrors");
274                         if (attribute != null && !attribute.equals("")) {
275                                 log.debug("Overriding passThruErrors for Relying Pary (" + name + ") with (" + attribute + ").");
276                                 overridenPassThruErrors = Boolean.valueOf(attribute).booleanValue();
277                                 passThruIsOverriden = true;
278                         }
279
280                         // SSO profile defaulting
281                         attribute = ((Element) partyConfig).getAttribute("defaultToPOSTProfile");
282                         if (attribute != null && !attribute.equals("")) {
283                                 defaultToPOST = Boolean.valueOf(attribute).booleanValue();
284                         }
285                         if (defaultToPOST) {
286                                 log.debug("Relying party defaults to POST profile.");
287                         } else {
288                                 log.debug("Relying party defaults to Artifact profile.");
289                         }
290
291                         // Relying Party wants assertions signed?
292                         attribute = ((Element) partyConfig).getAttribute("signAssertions");
293                         if (attribute != null && !attribute.equals("")) {
294                                 wantsAssertionsSigned = Boolean.valueOf(attribute).booleanValue();
295                         }
296                         if (wantsAssertionsSigned) {
297                                 log.debug("Relying party wants SAML Assertions to be signed.");
298                         } else {
299                                 log.debug("Relying party does not want SAML Assertions to be signed.");
300                         }
301
302                         // Determine whether or not we are forcing attribute push on or off
303                         String forcePush = ((Element) partyConfig).getAttribute("forceAttributePush");
304                         String forceNoPush = ((Element) partyConfig).getAttribute("forceAttributeNoPush");
305
306                         if (forcePush != null && Boolean.valueOf(forcePush).booleanValue() && forceNoPush != null
307                                         && Boolean.valueOf(forceNoPush).booleanValue()) {
308                                 log.error("Invalid configuration:  Attribute push is forced to ON and OFF for this relying "
309                                                 + "party.  Turning off forcing in favor of profile defaults.");
310                         } else {
311                                 forceAttributePush = Boolean.valueOf(forcePush).booleanValue();
312                                 forceAttributeNoPush = Boolean.valueOf(forceNoPush).booleanValue();
313                                 log.debug("Attribute push forcing is set to (" + forceAttributePush + ").");
314                                 log.debug("No attribute push forcing is set to (" + forceAttributeNoPush + ").");
315                         }
316
317                         // Load and verify the name format that the HS should use in
318                         // assertions for this RelyingParty
319                         NodeList hsNameFormats = ((Element) partyConfig).getElementsByTagNameNS(IdPConfig.configNameSpace,
320                                         "HSNameFormat");
321                         // If no specification. Make sure we have a default mapping
322                         if (hsNameFormats.getLength() < 1) {
323                                 if (nameMapper.getNameIdentifierMappingById(null) == null) {
324                                         log.error("Relying Party HS Name Format not set.  Add a <HSNameFormat> element to <RelyingParty>.");
325                                         throw new ServiceProviderMapperException("Required configuration not specified.");
326                                 }
327
328                         } else {
329                                 // We do have a specification, so make sure it points to a
330                                 // valid Name Mapping
331                                 if (hsNameFormats.getLength() > 1) {
332                                         log.warn("Found multiple HSNameFormat specifications for Relying Party (" + name
333                                                         + ").  Ignoring all but the first.");
334                                 }
335
336                                 hsNameFormatId = ((Element) hsNameFormats.item(0)).getAttribute("nameMapping");
337                                 if (hsNameFormatId == null || hsNameFormatId.equals("")) {
338                                         log.error("HS Name Format mapping not set.  Add a (nameMapping) attribute to <HSNameFormat>.");
339                                         throw new ServiceProviderMapperException("Required configuration not specified.");
340                                 }
341
342                                 if (nameMapper.getNameIdentifierMappingById(hsNameFormatId) == null) {
343                                         log.error("Relying Party HS Name Format refers to a name mapping that is not loaded.");
344                                         throw new ServiceProviderMapperException("Required configuration not specified.");
345                                 }
346                         }
347
348                         // Load the credential for signing
349                         String credentialName = ((Element) partyConfig).getAttribute("signingCredential");
350                         Credential signingCredential = credentials.getCredential(credentialName);
351                         if (signingCredential == null) {
352                                 if (credentialName == null || credentialName.equals("")) {
353                                         log.error("Relying Party credential not set.  Add a (signingCredential) "
354                                                         + "attribute to <RelyingParty>.");
355                                         throw new ServiceProviderMapperException("Required configuration not specified.");
356                                 } else {
357                                         log.error("Relying Party credential invalid.  Fix the (signingCredential) attribute "
358                                                         + "on <RelyingParty>.");
359                                         throw new ServiceProviderMapperException("Required configuration is invalid.");
360                                 }
361
362                         }
363
364                         // Initialize and Identity Provider object for this use by this relying party
365                         identityProvider = new RelyingPartyIdentityProvider(overridenOriginProviderId != null
366                                         ? overridenOriginProviderId
367                                         : configuration.getProviderId(), signingCredential);
368
369                 }
370
371                 public String getProviderId() {
372
373                         return name;
374                 }
375
376                 public String getName() {
377
378                         return name;
379                 }
380
381                 public IdentityProvider getIdentityProvider() {
382
383                         return identityProvider;
384                 }
385
386                 public boolean isLegacyProvider() {
387
388                         return false;
389                 }
390
391                 public String getHSNameFormatId() {
392
393                         return hsNameFormatId;
394                 }
395
396                 public URI getDefaultAuthMethod() {
397
398                         if (overridenDefaultAuthMethod != null) {
399                                 return overridenDefaultAuthMethod;
400                         } else {
401                                 return configuration.getDefaultAuthMethod();
402                         }
403                 }
404
405                 public URL getAAUrl() {
406
407                         if (overridenAAUrl != null) {
408                                 return overridenAAUrl;
409                         } else {
410                                 return configuration.getAAUrl();
411                         }
412                 }
413
414                 public boolean passThruErrors() {
415
416                         if (passThruIsOverriden) {
417                                 return overridenPassThruErrors;
418                         } else {
419                                 return configuration.passThruErrors();
420                         }
421                 }
422
423                 public boolean forceAttributePush() {
424
425                         return forceAttributePush;
426                 }
427
428                 public boolean forceAttributeNoPush() {
429
430                         return forceAttributeNoPush;
431                 }
432
433                 public boolean defaultToPOSTProfile() {
434
435                         return defaultToPOST;
436                 }
437
438                 public boolean wantsAssertionsSigned() {
439
440                         return wantsAssertionsSigned;
441                 }
442
443                 /**
444                  * Default identity provider implementation.
445                  * 
446                  * @author Walter Hoehn
447                  */
448                 protected class RelyingPartyIdentityProvider implements IdentityProvider {
449
450                         private String providerId;
451                         private Credential credential;
452
453                         public RelyingPartyIdentityProvider(String providerId, Credential credential) {
454
455                                 this.providerId = providerId;
456                                 this.credential = credential;
457                         }
458
459                         /*
460                          * @see edu.internet2.middleware.shibboleth.common.IdentityProvider#getProviderId()
461                          */
462                         public String getProviderId() {
463
464                                 return providerId;
465                         }
466
467                         /*
468                          * @see edu.internet2.middleware.shibboleth.common.IdentityProvider#getSigningCredential()
469                          */
470                         public Credential getSigningCredential() {
471
472                                 return credential;
473                         }
474                 }
475
476         }
477
478         /**
479          * Relying party implementation wrapper for relying parties that are federations.
480          * 
481          * @author Walter Hoehn
482          */
483         class RelyingPartyGroupWrapper implements RelyingParty {
484
485                 private RelyingParty wrapped;
486                 private String providerId;
487
488                 RelyingPartyGroupWrapper(RelyingParty wrapped, String providerId) {
489
490                         this.wrapped = wrapped;
491                         this.providerId = providerId;
492                 }
493
494                 public String getName() {
495
496                         return wrapped.getName();
497                 }
498
499                 public boolean isLegacyProvider() {
500
501                         return false;
502                 }
503
504                 public IdentityProvider getIdentityProvider() {
505
506                         return wrapped.getIdentityProvider();
507                 }
508
509                 public String getProviderId() {
510
511                         return providerId;
512                 }
513
514                 public String getHSNameFormatId() {
515
516                         return wrapped.getHSNameFormatId();
517                 }
518
519                 public URL getAAUrl() {
520
521                         return wrapped.getAAUrl();
522                 }
523
524                 public URI getDefaultAuthMethod() {
525
526                         return wrapped.getDefaultAuthMethod();
527                 }
528
529                 public boolean passThruErrors() {
530
531                         return wrapped.passThruErrors();
532                 }
533
534                 public boolean forceAttributePush() {
535
536                         return wrapped.forceAttributePush();
537                 }
538
539                 public boolean forceAttributeNoPush() {
540
541                         return wrapped.forceAttributeNoPush();
542                 }
543
544                 public boolean defaultToPOSTProfile() {
545
546                         return wrapped.defaultToPOSTProfile();
547                 }
548
549                 public boolean wantsAssertionsSigned() {
550
551                         return wrapped.wantsAssertionsSigned();
552                 }
553         }
554
555         /**
556          * Relying party implementation wrapper for anonymous service providers.
557          * 
558          * @author Walter Hoehn
559          */
560         protected class UnknownProviderWrapper implements RelyingParty {
561
562                 protected RelyingParty wrapped;
563                 protected String providerId;
564
565                 protected UnknownProviderWrapper(RelyingParty wrapped, String providerId) {
566
567                         this.wrapped = wrapped;
568                         this.providerId = providerId;
569                 }
570
571                 public String getName() {
572
573                         return wrapped.getName();
574                 }
575
576                 public IdentityProvider getIdentityProvider() {
577
578                         return wrapped.getIdentityProvider();
579                 }
580
581                 public String getProviderId() {
582
583                         return providerId;
584                 }
585
586                 public String getHSNameFormatId() {
587
588                         return wrapped.getHSNameFormatId();
589                 }
590
591                 public boolean isLegacyProvider() {
592
593                         return wrapped.isLegacyProvider();
594                 }
595
596                 public URL getAAUrl() {
597
598                         return wrapped.getAAUrl();
599                 }
600
601                 public URI getDefaultAuthMethod() {
602
603                         return wrapped.getDefaultAuthMethod();
604                 }
605
606                 public boolean passThruErrors() {
607
608                         return wrapped.passThruErrors();
609                 }
610
611                 public boolean forceAttributePush() {
612
613                         return false;
614                 }
615
616                 public boolean forceAttributeNoPush() {
617
618                         return false;
619                 }
620
621                 public boolean defaultToPOSTProfile() {
622
623                         return true;
624                 }
625
626                 public boolean wantsAssertionsSigned() {
627
628                         return wrapped.wantsAssertionsSigned();
629                 }
630         }
631
632         /**
633          * Relying party wrapper for Shibboleth &lt;=1.1 service providers.
634          * 
635          * @author Walter Hoehn
636          */
637         class LegacyWrapper extends UnknownProviderWrapper implements RelyingParty {
638
639                 LegacyWrapper(RelyingParty wrapped) {
640
641                         super(wrapped, null);
642                 }
643
644                 public boolean isLegacyProvider() {
645
646                         return true;
647                 }
648
649                 public String getHSNameFormatId() {
650
651                         return ((RelyingParty) wrapped).getHSNameFormatId();
652                 }
653
654                 public URL getAAUrl() {
655
656                         return ((RelyingParty) wrapped).getAAUrl();
657                 }
658
659                 public URI getDefaultAuthMethod() {
660
661                         return ((RelyingParty) wrapped).getDefaultAuthMethod();
662                 }
663         }
664
665         /**
666          * Relying party wrapper for providers for which we have no metadata
667          * 
668          * @author Walter Hoehn
669          */
670         class NoMetadataWrapper extends UnknownProviderWrapper implements RelyingParty {
671
672                 NoMetadataWrapper(RelyingParty wrapped) {
673
674                         super(wrapped, null);
675                 }
676
677                 public String getHSNameFormatId() {
678
679                         return ((RelyingParty) wrapped).getHSNameFormatId();
680                 }
681
682                 public URL getAAUrl() {
683
684                         return ((RelyingParty) wrapped).getAAUrl();
685                 }
686
687                 public URI getDefaultAuthMethod() {
688
689                         return ((RelyingParty) wrapped).getDefaultAuthMethod();
690                 }
691         }
692 }