If only one credential is loaded, use it as the default.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 23 Jan 2004 23:21:28 +0000 (23:21 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 23 Jan 2004 23:21:28 +0000 (23:21 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@854 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/common/Credentials.java

index a2e0aea..1324f75 100644 (file)
@@ -137,6 +137,12 @@ public class Credentials {
        }
 
        public Credential getCredential(String identifier) {
+
+               // Default if there is only one credential
+               if ((identifier == null || identifier.equals("")) && data.size() == 1) {
+                       return (Credential) data.values().iterator().next();
+               }
+
                return (Credential) data.get(identifier);
        }