Add support for pluggable NameIdentifiers based on Format.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 22 Jun 2005 03:30:17 +0000 (03:30 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 22 Jun 2005 03:30:17 +0000 (03:30 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1660 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

lib/opensaml-1.1.jar
src/edu/internet2/middleware/shibboleth/common/provider/CryptoShibHandle.java
src/edu/internet2/middleware/shibboleth/common/provider/PrincipalNameIdentifier.java
src/edu/internet2/middleware/shibboleth/common/provider/SharedMemoryShibHandle.java
src/edu/internet2/middleware/shibboleth/common/provider/X509SubjectNameNameIdentifierMapping.java
webApplication/WEB-INF/lib/opensaml-1.1.jar

index 5266091..06b1ef5 100644 (file)
Binary files a/lib/opensaml-1.1.jar and b/lib/opensaml-1.1.jar differ
index 7ebc4c9..7fd4713 100644 (file)
@@ -284,8 +284,10 @@ public class CryptoShibHandle extends AQHNameIdentifierMapping implements NameId
                        String handle = Base32.encode(handleBytes);
 
                        try {
-                               return new SAMLNameIdentifier(handle.replaceAll(System.getProperty("line.separator"), ""), idProv
-                                               .getProviderId(), getNameIdentifierFormat().toString());
+                               SAMLNameIdentifier nameid = SAMLNameIdentifier.getInstance(getNameIdentifierFormat().toString());
+                               nameid.setName(handle.replaceAll(System.getProperty("line.separator"), ""));
+                               nameid.setNameQualifier(idProv.getProviderId());
+                               return nameid;
                        } catch (SAMLException e) {
                                throw new NameIdentifierMappingException("Unable to generate Attribute Query Handle: " + e);
                        }
index 25a7822..f8868b0 100644 (file)
@@ -61,8 +61,10 @@ public class PrincipalNameIdentifier extends BaseNameIdentifierMapping {
                }
 
                try {
-                       return new SAMLNameIdentifier(principal.getName(), idProv.getProviderId(), getNameIdentifierFormat()
-                                       .toString());
+                       SAMLNameIdentifier nameid = SAMLNameIdentifier.getInstance(getNameIdentifierFormat().toString());
+                       nameid.setName(principal.getName());
+                       nameid.setNameQualifier(idProv.getProviderId());
+                       return nameid;
                } catch (SAMLException e) {
                        throw new NameIdentifierMappingException("Unable to generate Name Identifier: " + e);
                }
index 5baad9f..9b6cf18 100644 (file)
@@ -75,7 +75,11 @@ public class SharedMemoryShibHandle extends AQHNameIdentifierMapping implements
                                cache.handleEntries.put(handle, createHandleEntry(principal));
                        }
 
-                       return new SAMLNameIdentifier(handle, idProv.getProviderId(), getNameIdentifierFormat().toString());
+                       SAMLNameIdentifier nameid = SAMLNameIdentifier.getInstance(getNameIdentifierFormat().toString());
+                       nameid.setName(handle);
+                       nameid.setNameQualifier(idProv.getProviderId());
+                       return nameid;
+
                } catch (SAMLException e) {
                        throw new NameIdentifierMappingException("Unable to generate Attribute Query Handle: " + e);
                }
index 1c6666b..290defd 100644 (file)
@@ -117,8 +117,10 @@ public class X509SubjectNameNameIdentifierMapping extends BaseNameIdentifierMapp
                        throws NameIdentifierMappingException {
 
                try {
-                       return new SAMLNameIdentifier(internalNameContext.replaceAll("%PRINCIPAL%", principal.getName()),
-                                       qualifier, getNameIdentifierFormat().toString());
+                       SAMLNameIdentifier nameid = SAMLNameIdentifier.getInstance(getNameIdentifierFormat().toString());
+                       nameid.setName(internalNameContext.replaceAll("%PRINCIPAL%", principal.getName()));
+                       nameid.setNameQualifier(qualifier);
+                       return nameid;
                } catch (SAMLException e) {
                        throw new NameIdentifierMappingException("Unable to generate X509 SubjectName: " + e);
                }
index 5266091..06b1ef5 100644 (file)
Binary files a/webApplication/WEB-INF/lib/opensaml-1.1.jar and b/webApplication/WEB-INF/lib/opensaml-1.1.jar differ