/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { NameIdentifier nameIdentifier = (NameIdentifier) samlObject; if (NameIdentifier.FORMAT_ATTRIB_NAME.equals(attribute.getLocalName())) { nameIdentifier.setFormat(attribute.getValue()); } else if (NameIdentifier.NAMEQUALIFIER_ATTRIB_NAME.equals(attribute.getLocalName())) { nameIdentifier.setNameQualifier(attribute.getValue()); } else { super.processAttribute(samlObject, attribute); } }
/** * Create an efficient field-wise copy of a {@link NameIdentifier}. * * @param nameIdentifier the object to clone * * @return the copy */ @Nonnull private NameIdentifier cloneNameIdentifier(@Nonnull final NameIdentifier nameIdentifier) { final NameIdentifier clone = nameIdentifierBuilder.buildObject(); clone.setFormat(nameIdentifier.getFormat()); clone.setNameQualifier(nameIdentifier.getNameQualifier()); clone.setValue(nameIdentifier.getValue()); return clone; }
/** {@inheritDoc} */ @Override @Nullable protected NameIdentifier doGenerate(@Nonnull final ProfileRequestContext profileRequestContext) throws SAMLException { final String identifier = getIdentifier(profileRequestContext); if (identifier == null) { log.debug("No identifier to use"); return null; } log.debug("Generating NameIdentifier {} with Format {}", identifier, getFormat()); final NameIdentifier nameIdentifier = nameBuilder.buildObject(); nameIdentifier.setValue(identifier); nameIdentifier.setFormat(getFormat()); nameIdentifier.setNameQualifier(getEffectiveIdPNameQualifier(profileRequestContext)); if (getSPNameQualifier() != null) { log.warn("SPNameQualifier not supported for SAML 1 NameIdentifiers, omitting it"); } if (getSPProvidedID() != null) { log.warn("SPProvidedID not supported for SAML 1 NameIdentifiers, omitting it"); } return nameIdentifier; }
/** * Create an efficient field-wise copy of a {@link NameIdentifier}. * * @return the copy */ @Nonnull private NameIdentifier cloneNameIdentifier() { final NameIdentifier clone = nameIdentifierBuilder.buildObject(); clone.setFormat(nameIdentifier.getFormat()); clone.setNameQualifier(nameIdentifier.getNameQualifier()); clone.setValue(nameIdentifier.getValue()); return clone; }
nameId.setFormat(format); nameId.setNameQualifier(qualifier);
nameIdentifier.setFormat(nameIdFormat);
nameIdentifier.setFormat(subjectBean.getSubjectNameIDFormat()); String confirmationMethodStr = subjectBean.getSubjectConfirmationMethod();